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

public Class ScpRemote2RemoteTransferHelper

extends AbstractLoggingBean
Class Inheritance
Imports
java.io.EOFException, .IOException, .InputStream, .OutputStream, .StreamCorruptedException, java.nio.charset.Charset, java.util.Collection, .Collections, .EnumSet, .Objects, .Set, org.apache.sshd.client.channel.ChannelExec, org.apache.sshd.client.session.ClientSession, org.apache.sshd.common.util.SelectorUtils, org.apache.sshd.common.util.io.IoUtils, org.apache.sshd.common.util.io.input.LimitInputStream, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.scp.ScpModuleProperties, org.apache.sshd.scp.client.ScpClient.Option, org.apache.sshd.scp.common.helpers.AbstractScpCommandDetails, .ScpAckInfo, .ScpDirEndCommandDetails, .ScpIoUtils, .ScpPathCommandDetailsSupport, .ScpReceiveDirCommandDetails, .ScpReceiveFileCommandDetails, .ScpTimestampCommandDetails

Helps transfer files between 2 servers rather than between server and local file system by using 2 ClientSession-s and simply copying from one server to the other
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
protected final Charset
protected final Charset
private final ClientSession
protected final ScpRemote2RemoteTransferListener
private final ClientSession
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
executeTransfer(String source, Collection<ScpClient.Option> srcOptions, String destination, Collection<ScpClient.Option> dstOptions)

public ClientSession
public ClientSession
protected void
handleDirectoryTransferRequest(String srcPath, InputStream srcIn, OutputStream srcOut, String dstPath, InputStream dstIn, OutputStream dstOut, int depth, ScpTimestampCommandDetails dirTime, String header)

protected long
handleFileTransferRequest(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, ScpTimestampCommandDetails fileTime, String header)

protected Object
protected void
redirectDirectoryTransfer(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, int depth)

protected long
redirectFileTransfer(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut)

protected void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
transferDirectory(String
Source path in the source session
source
,
String
Destination path in the destination session
destination
,
boolean
Whether to preserve the attributes of the transferred file (e.g., permissions, file associated timestamps, etc.)
preserveAttributes
)

Transfers a directory

public void
transferFile(String
Source path in the source session
source
,
String
Destination path in the destination session
destination
,
boolean
Whether to preserve the attributes of the transferred file (e.g., permissions, file associated timestamps, etc.)
preserveAttributes
)

Transfers a single file

protected long
transferSimpleFile(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, String header, long length)

protected ScpAckInfo
protected String
transferTimestampCommand(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, String header)

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

csInback to summary
protected final Charset csIn
csOutback to summary
protected final Charset csOut
destSessionback to summary
private final ClientSession destSession
listenerback to summary
protected final ScpRemote2RemoteTransferListener listener
sourceSessionback to summary
private final ClientSession sourceSession

Constructor Detail

ScpRemote2RemoteTransferHelperback to summary
public ScpRemote2RemoteTransferHelper(ClientSession sourceSession, ClientSession destSession)
ScpRemote2RemoteTransferHelperback to summary
public ScpRemote2RemoteTransferHelper(ClientSession sourceSession, ClientSession destSession, ScpRemote2RemoteTransferListener listener)
Parameters
sourceSession:ClientSession

The source ClientSession

destSession:ClientSession

The destination ClientSession

listener:ScpRemote2RemoteTransferListener

An optional ScpRemote2RemoteTransferListener

Method Detail

executeTransferback to summary
protected void executeTransfer(String source, Collection<ScpClient.Option> srcOptions, String destination, Collection<ScpClient.Option> dstOptions) throws IOException
getDestinationSessionback to summary
public ClientSession getDestinationSession()
getSourceSessionback to summary
public ClientSession getSourceSession()
handleDirectoryTransferRequestback to summary
protected void handleDirectoryTransferRequest(String srcPath, InputStream srcIn, OutputStream srcOut, String dstPath, InputStream dstIn, OutputStream dstOut, int depth, ScpTimestampCommandDetails dirTime, String header) throws IOException
Annotations
@SuppressWarnings:checkstyle:ParameterNumber
handleFileTransferRequestback to summary
protected long handleFileTransferRequest(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, ScpTimestampCommandDetails fileTime, String header) throws IOException
receiveNextCmdback to summary
protected Object receiveNextCmd(Object logHint, InputStream in) throws IOException
redirectDirectoryTransferback to summary
protected void redirectDirectoryTransfer(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, int depth) throws IOException
redirectFileTransferback to summary
protected long redirectFileTransfer(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut) throws IOException
signalReceivedCommandback to summary
protected void signalReceivedCommand(AbstractScpCommandDetails details) throws IOException
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
transferDirectoryback to summary
public void transferDirectory(String source, String destination, boolean preserveAttributes) throws IOException

Transfers a directory

Parameters
source:String

Source path in the source session

destination:String

Destination path in the destination session

preserveAttributes:boolean

Whether to preserve the attributes of the transferred file (e.g., permissions, file associated timestamps, etc.)

Exceptions
IOException:
If failed to transfer
transferFileback to summary
public void transferFile(String source, String destination, boolean preserveAttributes) throws IOException

Transfers a single file

Parameters
source:String

Source path in the source session

destination:String

Destination path in the destination session

preserveAttributes:boolean

Whether to preserve the attributes of the transferred file (e.g., permissions, file associated timestamps, etc.)

Exceptions
IOException:
If failed to transfer
transferSimpleFileback to summary
protected long transferSimpleFile(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, String header, long length) throws IOException
transferStatusCodeback to summary
protected ScpAckInfo transferStatusCode(Object logHint, InputStream in, OutputStream out) throws IOException
transferTimestampCommandback to summary
protected String transferTimestampCommand(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, String header) throws IOException