public class ScpRemote2RemoteTransferHelper extends AbstractLoggingBean
ClientSession
-s and simply copying from one server to the otherModifier 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) |
protected 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 ClientSession
destSession
- The destination ClientSession
listener
- An optional ScpRemote2RemoteTransferListener
public 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
IOException
protected long redirectFileTransfer(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut) throws IOException
IOException
protected long handleFileTransferRequest(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, ScpTimestampCommandDetails fileTime, String header) throws IOException
IOException
protected void redirectDirectoryTransfer(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, int depth) throws IOException
IOException
protected void handleDirectoryTransferRequest(String srcPath, InputStream srcIn, OutputStream srcOut, String dstPath, InputStream dstIn, OutputStream dstOut, int depth, ScpTimestampCommandDetails dirTime, String header) throws IOException
IOException
protected long transferSimpleFile(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, String header, long length) throws IOException
IOException
protected String transferTimestampCommand(String source, InputStream srcIn, OutputStream srcOut, String destination, InputStream dstIn, OutputStream dstOut, String header) throws IOException
IOException
protected ScpAckInfo transferStatusCode(Object logHint, InputStream in, OutputStream out) throws IOException
IOException
protected Object receiveNextCmd(Object logHint, InputStream in) throws IOException
IOException
protected void signalReceivedCommand(AbstractScpCommandDetails details) throws IOException
IOException
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.