public class LocalFileScpSourceStreamResolver extends AbstractLoggingBean implements ScpSourceStreamResolver
Modifier and Type | Field and Description |
---|---|
protected Path |
name |
protected ScpFileOpener |
opener |
protected Path |
path |
protected Set<PosixFilePermission> |
perms |
protected long |
size |
protected ScpTimestamp |
time |
log
Constructor and Description |
---|
LocalFileScpSourceStreamResolver(Path path,
ScpFileOpener opener) |
Modifier and Type | Method and Description |
---|---|
Path |
getEventListenerFilePath() |
String |
getFileName() |
Collection<PosixFilePermission> |
getPermissions() |
long |
getSize() |
ScpTimestamp |
getTimestamp() |
InputStream |
resolveSourceStream(Session session,
long length,
Set<PosixFilePermission> permissions,
OpenOption... options) |
String |
toString() |
getSimplifiedLogger
protected final Path path
protected final ScpFileOpener opener
protected final Path name
protected final Set<PosixFilePermission> perms
protected final long size
protected final ScpTimestamp time
public LocalFileScpSourceStreamResolver(Path path, ScpFileOpener opener) throws IOException
IOException
public String getFileName() throws IOException
getFileName
in interface ScpSourceStreamResolver
IOException
- If failed to resolve the namepublic Collection<PosixFilePermission> getPermissions() throws IOException
getPermissions
in interface ScpSourceStreamResolver
IOException
- If failed to generate the required permissionspublic ScpTimestamp getTimestamp() throws IOException
getTimestamp
in interface ScpSourceStreamResolver
ScpTimestamp
to use for uploading the file
if null
then no need to send this informationIOException
- If failed to generate the required datapublic long getSize() throws IOException
getSize
in interface ScpSourceStreamResolver
IOException
- If failed to generate an estimatepublic Path getEventListenerFilePath()
getEventListenerFilePath
in interface ScpSourceStreamResolver
Path
to use when invoking the ScpTransferEventListener
public InputStream resolveSourceStream(Session session, long length, Set<PosixFilePermission> permissions, OpenOption... options) throws 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 uploadedIOException
- If failed to create the streamCopyright © 2008–2022 The Apache Software Foundation. All rights reserved.