Top Fields Constructors Methods
org.apache.sshd.scp.client

public Class DefaultScpStreamResolver

extends Object
implements ScpSourceStreamResolver
Class Inheritance
All Implemented Interfaces
org.apache.sshd.scp.common.ScpSourceStreamResolver
Imports
java.io.IOException, .InputStream, java.nio.file.OpenOption, .Path, java.nio.file.attribute.PosixFilePermission, java.util.Collection, .Set, org.apache.sshd.common.session.Session, org.apache.sshd.scp.common.ScpSourceStreamResolver, org.apache.sshd.scp.common.helpers.ScpTimestampCommandDetails

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final String
private final InputStream
private final Path
private final String
private final Collection<PosixFilePermission>
private final long
private final ScpTimestampCommandDetails

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Path
public String
public Collection<PosixFilePermission>
public long
public ScpTimestampCommandDetails
public InputStream
resolveSourceStream(Session
The Session through which file is transmitted
session
,
long
The expected transfer byte count
length
,
Set<PosixFilePermission>
The requested file permissions
permissions
,
OpenOption...
The OpenOptions may be null/empty
options
)

Implements org.apache.sshd.scp.common.ScpSourceStreamResolver.resolveSourceStream.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cmdback to summary
private final String cmd
localback to summary
private final InputStream local
mockPathback to summary
private final Path mockPath
nameback to summary
private final String name
permsback to summary
private final Collection<PosixFilePermission> perms
sizeback to summary
private final long size
timeback to summary
private final ScpTimestampCommandDetails time

Constructor Detail

DefaultScpStreamResolverback to summary
public DefaultScpStreamResolver(String name, Path mockPath, Collection<PosixFilePermission> perms, ScpTimestampCommandDetails time, long size, InputStream local, String cmd)

Method Detail

getEventListenerFilePathback to summary
public Path getEventListenerFilePath()

Implements org.apache.sshd.scp.common.ScpSourceStreamResolver.getEventListenerFilePath.

Returns:Path

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getEventListenerFilePath.

The Path to use when invoking the ScpTransferEventListener

Annotations
@Override
getFileNameback to summary
public String getFileName() throws IOException

Implements org.apache.sshd.scp.common.ScpSourceStreamResolver.getFileName.

Returns:String

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getFileName.

The uploaded file name

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getFileName.

If failed to resolve the name

getPermissionsback to summary
public Collection<PosixFilePermission> getPermissions() throws IOException

Implements org.apache.sshd.scp.common.ScpSourceStreamResolver.getPermissions.

Returns:Collection<PosixFilePermission>

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getPermissions.

The permissions to be used for uploading a file

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getPermissions.

If failed to generate the required permissions

getSizeback to summary
public long getSize() throws IOException

Implements org.apache.sshd.scp.common.ScpSourceStreamResolver.getSize.

Returns:long

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getSize.

An estimated size of the expected number of bytes to be uploaded. If non-positive then assumed to be unknown.

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getSize.

If failed to generate an estimate

getTimestampback to summary
public ScpTimestampCommandDetails getTimestamp() throws IOException

Implements org.apache.sshd.scp.common.ScpSourceStreamResolver.getTimestamp.

Returns:ScpTimestampCommandDetails

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getTimestamp.

The ScpTimestampCommandDetails to use for uploading the file if null then no need to send this information

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.getTimestamp.

If failed to generate the required data

resolveSourceStreamback to summary
public InputStream resolveSourceStream(Session session, long length, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException

Implements org.apache.sshd.scp.common.ScpSourceStreamResolver.resolveSourceStream.

Parameters
session:Session

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.resolveSourceStream.

The Session through which file is transmitted

length:long

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.resolveSourceStream.

The expected transfer byte count

permissions:Set<PosixFilePermission>

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.resolveSourceStream.

The requested file permissions

options:OpenOption[]

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.resolveSourceStream.

The OpenOptions may be null/empty

Returns:InputStream

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.resolveSourceStream.

The InputStream containing the data to be uploaded

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.scp.common.ScpSourceStreamResolver.resolveSourceStream.

If failed to create the stream

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override