public class LocalFileScpSourceStreamResolver extends AbstractLoggingBean implements ScpSourceStreamResolver
Modifier and Type | Field and Description |
---|---|
protected java.nio.file.Path |
name |
protected ScpFileOpener |
opener |
protected java.nio.file.Path |
path |
protected java.util.Set<java.nio.file.attribute.PosixFilePermission> |
perms |
protected long |
size |
protected ScpTimestamp |
time |
log
Constructor and Description |
---|
LocalFileScpSourceStreamResolver(java.nio.file.Path path,
ScpFileOpener opener) |
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() |
ScpTimestamp |
getTimestamp() |
java.io.InputStream |
resolveSourceStream(Session session,
java.nio.file.OpenOption... options) |
java.lang.String |
toString() |
getSimplifiedLogger
protected final java.nio.file.Path path
protected final ScpFileOpener opener
protected final java.nio.file.Path name
protected final java.util.Set<java.nio.file.attribute.PosixFilePermission> perms
protected final long size
protected final ScpTimestamp time
public LocalFileScpSourceStreamResolver(java.nio.file.Path path, ScpFileOpener opener) throws java.io.IOException
java.io.IOException
public java.lang.String getFileName() throws java.io.IOException
getFileName
in interface ScpSourceStreamResolver
java.io.IOException
- If failed to resolve the namepublic 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 ScpTimestamp getTimestamp() throws java.io.IOException
getTimestamp
in interface ScpSourceStreamResolver
ScpTimestamp
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.nio.file.Path getEventListenerFilePath()
getEventListenerFilePath
in interface ScpSourceStreamResolver
Path
to use when invoking the ScpTransferEventListener
public java.io.InputStream resolveSourceStream(Session session, java.nio.file.OpenOption... options) throws java.io.IOException
resolveSourceStream
in interface ScpSourceStreamResolver
session
- The Session
through which file is transmittedoptions
- 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