public class LocalFileScpTargetStreamResolver extends org.apache.sshd.common.util.logging.AbstractLoggingBean implements ScpTargetStreamResolver
| Modifier and Type | Field and Description |
|---|---|
protected ScpFileOpener |
opener |
protected Path |
path |
protected Boolean |
status |
log| Constructor and Description |
|---|
LocalFileScpTargetStreamResolver(Path path,
ScpFileOpener opener) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeTargetStream(Session session,
String name,
long length,
Set<PosixFilePermission> perms,
OutputStream stream)
Called when target stream received from
resolveTargetStream call is no longer needed since copy is successfully completed. |
Path |
getEventListenerFilePath() |
void |
postProcessReceivedData(String name,
boolean preserve,
Set<PosixFilePermission> perms,
ScpTimestampCommandDetails time)
Called after successful reception of the data (and after closing the stream)
|
OutputStream |
resolveTargetStream(Session session,
String name,
long length,
Set<PosixFilePermission> perms,
OpenOption... options)
Called when receiving a file in order to obtain an output stream for the incoming data
|
String |
toString() |
protected void |
updateFileProperties(String name,
Path path,
Set<PosixFilePermission> perms,
ScpTimestampCommandDetails time) |
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 Boolean status
public LocalFileScpTargetStreamResolver(Path path, ScpFileOpener opener) throws IOException
IOExceptionpublic OutputStream resolveTargetStream(Session session, String name, long length, Set<PosixFilePermission> perms, OpenOption... options) throws IOException
ScpTargetStreamResolverresolveTargetStream in interface ScpTargetStreamResolversession - The associated Sessionname - File name as received from remote sitelength - Number of bytes expected to receiveperms - The Set of PosixFilePermission expectedoptions - The OpenOptions to use - may be null/emptyOutputStream to write the incoming dataIOException - If failed to create the streampublic void closeTargetStream(Session session, String name, long length, Set<PosixFilePermission> perms, OutputStream stream) throws IOException
ScpTargetStreamResolverresolveTargetStream call is no longer needed since copy is successfully completed.closeTargetStream in interface ScpTargetStreamResolversession - The associated Sessionname - File name as received from remote sitelength - Number of bytes expected to receiveperms - The Set of PosixFilePermission expectedstream - The OutputStream to closeIOException - If failed to close the stream - Note: stream will be closed regardless of whether this
method throws an exception or not.public Path getEventListenerFilePath()
getEventListenerFilePath in interface ScpTargetStreamResolverPath to use when invoking the ScpTransferEventListenerpublic void postProcessReceivedData(String name, boolean preserve, Set<PosixFilePermission> perms, ScpTimestampCommandDetails time) throws IOException
ScpTargetStreamResolverpostProcessReceivedData in interface ScpTargetStreamResolvername - File name as received from remote sitepreserve - If true then the resolver should attempt to preserve the specified permissions and
timestampperms - The Set of PosixFilePermission expectedtime - If not null then the required timestamp(s) on the incoming dataIOException - If failed to post-process the incoming dataprotected void updateFileProperties(String name, Path path, Set<PosixFilePermission> perms, ScpTimestampCommandDetails time) throws IOException
IOExceptionCopyright © 2018–2021 The Apache Software Foundation. All rights reserved.