public class ScpRemote2RemoteTransferHelper extends org.apache.sshd.common.util.logging.AbstractLoggingBean
ClientSession-s and simply copying from one server to the other| Modifier and Type | Field and Description |
|---|---|
protected Charset |
csIn |
protected Charset |
csOut |
protected ScpRemote2RemoteTransferListener |
listener |
log| Constructor and Description |
|---|
ScpRemote2RemoteTransferHelper(ClientSession sourceSession,
ClientSession destSession) |
ScpRemote2RemoteTransferHelper(ClientSession sourceSession,
ClientSession destSession,
ScpRemote2RemoteTransferListener listener) |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnprotected final ScpRemote2RemoteTransferListener listener
protected final Charset csIn
protected final Charset csOut
public ScpRemote2RemoteTransferHelper(ClientSession sourceSession, ClientSession destSession)
public ScpRemote2RemoteTransferHelper(ClientSession sourceSession, ClientSession destSession, ScpRemote2RemoteTransferListener listener)
sourceSession - The source ClientSessiondestSession - The destination ClientSessionlistener - An optional ScpRemote2RemoteTransferListenerpublic ClientSession getSourceSession()
public ClientSession getDestinationSession()
public void transferFile(String source, String destination, boolean preserveAttributes) throws IOException
source - Source path in the source sessiondestination - Destination path in the destination sessionpreserveAttributes - Whether to preserve the attributes of the transferred file (e.g., permissions, file
associated timestamps, etc.)IOException - If failed to transferpublic void transferDirectory(String source, String destination, boolean preserveAttributes) throws IOException
source - Source path in the source sessiondestination - Destination path in the destination sessionpreserveAttributes - Whether to preserve the attributes of the transferred file (e.g., permissions, file
associated timestamps, etc.)IOException - If failed to transferprotected void executeTransfer(String source, Collection<ScpClient.Option> srcOptions, String destination, Collection<ScpClient.Option> dstOptions) throws IOException
IOExceptionprotected long redirectFileTransfer(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut) throws IOException
IOExceptionprotected long handleFileTransferRequest(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, ScpTimestampCommandDetails fileTime, String header) throws IOException
IOExceptionprotected void redirectDirectoryTransfer(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, int depth) throws IOException
IOExceptionprotected void handleDirectoryTransferRequest(String srcPath, InputStream srcIn, OutputStream srcOut, String dstPath, InputStream dstIn, OutputStream dstOut, int depth, ScpTimestampCommandDetails dirTime, String header) throws IOException
IOExceptionprotected long transferSimpleFile(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, String header, long length) throws IOException
IOExceptionprotected String transferTimestampCommand(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, String header) throws IOException
IOExceptionprotected ScpAckInfo transferStatusCode(Object logHint, InputStream in, OutputStream out) throws IOException
IOExceptionprotected Object receiveNextCmd(Object logHint, InputStream in) throws IOException
IOExceptionprotected void signalReceivedCommand(AbstractScpCommandDetails details) throws IOException
IOExceptionCopyright © 2018–2021 The Apache Software Foundation. All rights reserved.