public interface ScpTargetStreamResolver
Modifier and Type | Method and Description |
---|---|
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.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
session
- The associated Session
name
- File name as received from remote sitelength
- Number of bytes expected to receiveperms
- The Set
of PosixFilePermission
expectedoptions
- The OpenOption
s to use - may be null
/emptyOutputStream
to write the incoming datajava.io.IOException
- If failed to create the streamjava.nio.file.Path getEventListenerFilePath()
Path
to use when invoking the ScpTransferEventListener
void postProcessReceivedData(java.lang.String name, boolean preserve, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms, ScpTimestamp time) throws java.io.IOException
name
- 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 data