Top Methods
org.apache.sshd.scp.common

public Interface ScpSourceStreamResolver

Known Direct Implementers
org.apache.sshd.scp.common.helpers.LocalFileScpSourceStreamResolver, org.apache.sshd.scp.client.DefaultScpStreamResolver
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.helpers.ScpTimestampCommandDetails

Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public default void
closeSourceStream(Session
The Session through which file is transmitted
session
,
long
The expected transfer byte count
fileSize
,
Set<PosixFilePermission>
The requested file permissions
permissions
,
InputStream
The InputStream to close
stream
)

Called when the stream obtained from resolveSourceStream is no longer needed since since file copy was completed successfully.

public Path

Returns:

The Path to use when invoking the ScpTransferEventListener
getEventListenerFilePath
()

public String

Returns:

The uploaded file name
getFileName
()

public Collection<PosixFilePermission>

Returns:

The permissions to be used for uploading a file
getPermissions
()

public long

Returns:

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

public ScpTimestampCommandDetails

Returns:

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

public InputStream

Returns:

The InputStream containing the data to be uploaded
resolveSourceStream
(Session
The Session through which file is transmitted
session
,
long
The expected transfer byte count
fileSize
,
Set<PosixFilePermission>
The requested file permissions
permissions
,
OpenOption...
The OpenOptions may be null/empty
options
)

Method Detail

closeSourceStreamback to summary
public default void closeSourceStream(Session session, long fileSize, Set<PosixFilePermission> permissions, InputStream stream) throws IOException

Called when the stream obtained from resolveSourceStream is no longer needed since since file copy was completed successfully.

Parameters
session:Session

The Session through which file is transmitted

fileSize:long

The expected transfer byte count

permissions:Set<PosixFilePermission>

The requested file permissions

stream:InputStream

The InputStream to close

Exceptions
IOException:
If failed to close the stream - Note: stream will be closed regardless of whether this method throws an exception or not.
getEventListenerFilePathback to summary
public Path getEventListenerFilePath()
Returns:Path

The Path to use when invoking the ScpTransferEventListener

getFileNameback to summary
public String getFileName() throws IOException
Returns:String

The uploaded file name

Exceptions
IOException:
If failed to resolve the name
getPermissionsback to summary
public Collection<PosixFilePermission> getPermissions() throws IOException
Returns:Collection<PosixFilePermission>

The permissions to be used for uploading a file

Exceptions
IOException:
If failed to generate the required permissions
getSizeback to summary
public long getSize() throws IOException
Returns:long

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

Exceptions
IOException:
If failed to generate an estimate
getTimestampback to summary
public ScpTimestampCommandDetails getTimestamp() throws IOException
Returns:ScpTimestampCommandDetails

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

Exceptions
IOException:
If failed to generate the required data
resolveSourceStreamback to summary
public InputStream resolveSourceStream(Session session, long fileSize, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException
Parameters
session:Session

The Session through which file is transmitted

fileSize:long

The expected transfer byte count

permissions:Set<PosixFilePermission>

The requested file permissions

options:OpenOption[]

The OpenOptions may be null/empty

Returns:InputStream

The InputStream containing the data to be uploaded

Exceptions
IOException:
If failed to create the stream