public class LocalFileScpTargetStreamResolver extends AbstractLoggingBean implements ScpTargetStreamResolver
| Modifier and Type | Field and Description |
|---|---|
private java.nio.file.Path |
file |
protected ScpFileOpener |
opener |
protected java.nio.file.Path |
path |
protected java.lang.Boolean |
status |
log| Constructor and Description |
|---|
LocalFileScpTargetStreamResolver(java.nio.file.Path path,
ScpFileOpener opener) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeTargetStream(Session session,
java.lang.String name,
long length,
java.util.Set<java.nio.file.attribute.PosixFilePermission> perms,
java.io.OutputStream stream)
Called when target stream received from
resolveTargetStream call is no longer needed since copy is successfully completed. |
java.nio.file.Path |
getEventListenerFilePath() |
void |
postProcessReceivedData(java.lang.String name,
boolean preserve,
java.util.Set<java.nio.file.attribute.PosixFilePermission> perms,
ScpTimestamp time)
Called after successful reception of the data (and after closing the stream)
|
java.io.OutputStream |
resolveTargetStream(Session session,
java.lang.String name,
long length,
java.util.Set<java.nio.file.attribute.PosixFilePermission> perms,
java.nio.file.OpenOption... options)
Called when receiving a file in order to obtain an output stream for the incoming data
|
java.lang.String |
toString() |
protected void |
updateFileProperties(java.lang.String name,
java.nio.file.Path path,
java.util.Set<java.nio.file.attribute.PosixFilePermission> perms,
ScpTimestamp time) |
getSimplifiedLoggerprotected final java.nio.file.Path path
protected final ScpFileOpener opener
protected final java.lang.Boolean status
private java.nio.file.Path file
public LocalFileScpTargetStreamResolver(java.nio.file.Path path,
ScpFileOpener opener)
throws java.io.IOException
java.io.IOExceptionpublic java.io.OutputStream resolveTargetStream(Session session, java.lang.String name, long length, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms, java.nio.file.OpenOption... options) throws java.io.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 datajava.io.IOException - If failed to create the streampublic void closeTargetStream(Session session, java.lang.String name, long length, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms, java.io.OutputStream stream) throws java.io.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 closejava.io.IOException - If failed to close the stream - Note: stream will be closed regardless of whether this
method throws an exception or not.public java.nio.file.Path getEventListenerFilePath()
getEventListenerFilePath in interface ScpTargetStreamResolverPath to use when invoking the ScpTransferEventListenerpublic void postProcessReceivedData(java.lang.String name,
boolean preserve,
java.util.Set<java.nio.file.attribute.PosixFilePermission> perms,
ScpTimestamp time)
throws java.io.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 datajava.io.IOException - If failed to post-process the incoming dataprotected void updateFileProperties(java.lang.String name,
java.nio.file.Path path,
java.util.Set<java.nio.file.attribute.PosixFilePermission> perms,
ScpTimestamp time)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object