public interface ScpSourceStreamResolver
Modifier and Type | Method and Description |
---|---|
default void |
closeSourceStream(Session session,
long fileSize,
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 fileSize,
Set<PosixFilePermission> permissions,
OpenOption... options) |
String getFileName() throws IOException
IOException
- If failed to resolve the namePath getEventListenerFilePath()
Path
to use when invoking the ScpTransferEventListener
Collection<PosixFilePermission> getPermissions() throws IOException
IOException
- If failed to generate the required permissionsScpTimestampCommandDetails getTimestamp() throws IOException
ScpTimestampCommandDetails
to use for uploading the file if null
then no
need to send this informationIOException
- If failed to generate the required datalong getSize() throws IOException
IOException
- If failed to generate an estimateInputStream resolveSourceStream(Session session, long fileSize, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException
session
- The Session
through which file is transmittedfileSize
- The expected transfer byte countpermissions
- The requested file permissionsoptions
- The OpenOption
s may be null
/emptyInputStream
containing the data to be uploadedIOException
- If failed to create the streamdefault void closeSourceStream(Session session, long fileSize, Set<PosixFilePermission> permissions, InputStream stream) throws IOException
resolveSourceStream
is no longer needed since since file copy was completed successfully.session
- The Session
through which file is transmittedfileSize
- 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 © 2008–2024 The Apache Software Foundation. All rights reserved.