public class DefaultScpStreamResolver extends java.lang.Object implements ScpSourceStreamResolver
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
cmd |
private java.io.InputStream |
local |
private java.nio.file.Path |
mockPath |
private java.lang.String |
name |
private java.util.Collection<java.nio.file.attribute.PosixFilePermission> |
perms |
private long |
size |
private ScpTimestampCommandDetails |
time |
Constructor and Description |
---|
DefaultScpStreamResolver(java.lang.String name,
java.nio.file.Path mockPath,
java.util.Collection<java.nio.file.attribute.PosixFilePermission> perms,
ScpTimestampCommandDetails time,
long size,
java.io.InputStream local,
java.lang.String cmd) |
Modifier and Type | Method and Description |
---|---|
java.nio.file.Path |
getEventListenerFilePath() |
java.lang.String |
getFileName() |
java.util.Collection<java.nio.file.attribute.PosixFilePermission> |
getPermissions() |
long |
getSize() |
ScpTimestampCommandDetails |
getTimestamp() |
java.io.InputStream |
resolveSourceStream(Session session,
long length,
java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions,
java.nio.file.OpenOption... options) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
closeSourceStream
private final java.lang.String name
private final java.nio.file.Path mockPath
private final java.util.Collection<java.nio.file.attribute.PosixFilePermission> perms
private final ScpTimestampCommandDetails time
private final long size
private final java.io.InputStream local
private final java.lang.String cmd
public DefaultScpStreamResolver(java.lang.String name, java.nio.file.Path mockPath, java.util.Collection<java.nio.file.attribute.PosixFilePermission> perms, ScpTimestampCommandDetails time, long size, java.io.InputStream local, java.lang.String cmd)
public java.lang.String getFileName() throws java.io.IOException
getFileName
in interface ScpSourceStreamResolver
java.io.IOException
- If failed to resolve the namepublic java.nio.file.Path getEventListenerFilePath()
getEventListenerFilePath
in interface ScpSourceStreamResolver
Path
to use when invoking the ScpTransferEventListener
public java.util.Collection<java.nio.file.attribute.PosixFilePermission> getPermissions() throws java.io.IOException
getPermissions
in interface ScpSourceStreamResolver
java.io.IOException
- If failed to generate the required permissionspublic ScpTimestampCommandDetails getTimestamp() throws java.io.IOException
getTimestamp
in interface ScpSourceStreamResolver
ScpTimestampCommandDetails
to use for uploading the file if null
then no
need to send this informationjava.io.IOException
- If failed to generate the required datapublic long getSize() throws java.io.IOException
getSize
in interface ScpSourceStreamResolver
java.io.IOException
- If failed to generate an estimatepublic java.io.InputStream resolveSourceStream(Session session, long length, java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions, java.nio.file.OpenOption... options) throws java.io.IOException
resolveSourceStream
in interface ScpSourceStreamResolver
session
- The Session
through which file is transmittedlength
- The expected transfer byte countpermissions
- The requested file permissionsoptions
- The OpenOption
s may be null
/emptyInputStream
containing the data to be uploadedjava.io.IOException
- If failed to create the streampublic java.lang.String toString()
toString
in class java.lang.Object