public class DefaultScpStreamResolver extends Object implements ScpSourceStreamResolver
Constructor and Description |
---|
DefaultScpStreamResolver(String name,
Path mockPath,
Collection<PosixFilePermission> perms,
ScpTimestamp time,
long size,
InputStream local,
String cmd) |
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() |
public DefaultScpStreamResolver(String name, Path mockPath, Collection<PosixFilePermission> perms, ScpTimestamp time, long size, InputStream local, String cmd)
public String getFileName() throws IOException
getFileName
in interface ScpSourceStreamResolver
IOException
- If failed to resolve the namepublic Path getEventListenerFilePath()
getEventListenerFilePath
in interface ScpSourceStreamResolver
Path
to use when invoking the ScpTransferEventListener
public 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 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.