Package org.apache.sshd.scp.client
Class DefaultScpStreamResolver
- java.lang.Object
-
- org.apache.sshd.scp.client.DefaultScpStreamResolver
-
- All Implemented Interfaces:
ScpSourceStreamResolver
public class DefaultScpStreamResolver extends Object implements ScpSourceStreamResolver
- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Constructor Description DefaultScpStreamResolver(String name, Path mockPath, Collection<PosixFilePermission> perms, ScpTimestampCommandDetails time, long size, InputStream local, String cmd)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathgetEventListenerFilePath()StringgetFileName()Collection<PosixFilePermission>getPermissions()longgetSize()ScpTimestampCommandDetailsgetTimestamp()InputStreamresolveSourceStream(Session session, long length, Set<PosixFilePermission> permissions, OpenOption... options)StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.scp.common.ScpSourceStreamResolver
closeSourceStream
-
-
-
-
Constructor Detail
-
DefaultScpStreamResolver
public DefaultScpStreamResolver(String name, Path mockPath, Collection<PosixFilePermission> perms, ScpTimestampCommandDetails time, long size, InputStream local, String cmd)
-
-
Method Detail
-
getFileName
public String getFileName() throws IOException
- Specified by:
getFileNamein interfaceScpSourceStreamResolver- Returns:
- The uploaded file name
- Throws:
IOException- If failed to resolve the name
-
getEventListenerFilePath
public Path getEventListenerFilePath()
- Specified by:
getEventListenerFilePathin interfaceScpSourceStreamResolver- Returns:
- The
Pathto use when invoking theScpTransferEventListener
-
getPermissions
public Collection<PosixFilePermission> getPermissions() throws IOException
- Specified by:
getPermissionsin interfaceScpSourceStreamResolver- Returns:
- The permissions to be used for uploading a file
- Throws:
IOException- If failed to generate the required permissions
-
getTimestamp
public ScpTimestampCommandDetails getTimestamp() throws IOException
- Specified by:
getTimestampin interfaceScpSourceStreamResolver- Returns:
- The
ScpTimestampCommandDetailsto use for uploading the file ifnullthen no need to send this information - Throws:
IOException- If failed to generate the required data
-
getSize
public long getSize() throws IOException- Specified by:
getSizein interfaceScpSourceStreamResolver- Returns:
- An estimated size of the expected number of bytes to be uploaded. If non-positive then assumed to be unknown.
- Throws:
IOException- If failed to generate an estimate
-
resolveSourceStream
public InputStream resolveSourceStream(Session session, long length, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException
- Specified by:
resolveSourceStreamin interfaceScpSourceStreamResolver- Parameters:
session- TheSessionthrough which file is transmittedlength- The expected transfer byte countpermissions- The requested file permissionsoptions- TheOpenOptions may benull/empty- Returns:
- The
InputStreamcontaining the data to be uploaded - Throws:
IOException- If failed to create the stream
-
-