public class LocalFileScpSourceStreamResolver extends org.apache.sshd.common.util.logging.AbstractLoggingBean implements ScpSourceStreamResolver
| Modifier and Type | Field and Description |
|---|---|
protected Path |
name |
protected ScpFileOpener |
opener |
protected Path |
path |
protected Set<PosixFilePermission> |
perms |
protected long |
size |
protected ScpTimestampCommandDetails |
time |
log| Constructor and Description |
|---|
LocalFileScpSourceStreamResolver(Path path,
ScpFileOpener opener) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeSourceStream(Session session,
long length,
Set<PosixFilePermission> permissions,
InputStream stream)
Called when the stream obtained from
resolveSourceStream is no longer needed since since file copy was completed successfully. |
Path |
getEventListenerFilePath() |
String |
getFileName() |
Collection<PosixFilePermission> |
getPermissions() |
long |
getSize() |
ScpTimestampCommandDetails |
getTimestamp() |
InputStream |
resolveSourceStream(Session session,
long length,
Set<PosixFilePermission> permissions,
OpenOption... options) |
String |
toString() |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnprotected final Path path
protected final ScpFileOpener opener
protected final Path name
protected final Set<PosixFilePermission> perms
protected final long size
protected final ScpTimestampCommandDetails time
public LocalFileScpSourceStreamResolver(Path path, ScpFileOpener opener) throws IOException
IOExceptionpublic String getFileName() throws IOException
getFileName in interface ScpSourceStreamResolverIOException - If failed to resolve the namepublic Collection<PosixFilePermission> getPermissions() throws IOException
getPermissions in interface ScpSourceStreamResolverIOException - If failed to generate the required permissionspublic ScpTimestampCommandDetails getTimestamp() throws IOException
getTimestamp in interface ScpSourceStreamResolverScpTimestampCommandDetails to use for uploading the file if null then no
need to send this informationIOException - If failed to generate the required datapublic long getSize()
throws IOException
getSize in interface ScpSourceStreamResolverIOException - If failed to generate an estimatepublic Path getEventListenerFilePath()
getEventListenerFilePath in interface ScpSourceStreamResolverPath to use when invoking the ScpTransferEventListenerpublic InputStream resolveSourceStream(Session session, long length, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException
resolveSourceStream in interface ScpSourceStreamResolversession - The Session through which file is transmittedlength - The expected transfer byte countpermissions - The requested file permissionsoptions - The OpenOptions may be null/emptyInputStream containing the data to be uploadedIOException - If failed to create the streampublic void closeSourceStream(Session session, long length, Set<PosixFilePermission> permissions, InputStream stream) throws IOException
ScpSourceStreamResolverresolveSourceStream is no longer needed since since file copy was completed successfully.closeSourceStream in interface ScpSourceStreamResolversession - The Session through which file is transmittedlength - The expected transfer byte countpermissions - The requested file permissionsstream - The InputStream to closeIOException - If failed to close the stream - Note: stream will be closed regardless of whether this
method throws an exception or not.Copyright © 2018–2021 The Apache Software Foundation. All rights reserved.