Package net.schmizz.sshj.xfer.scp
Class SCPDownloadClient
java.lang.Object
net.schmizz.sshj.xfer.scp.AbstractSCPClient
net.schmizz.sshj.xfer.scp.SCPDownloadClient
Support for downloading files over a connected link using SCP.
-
Field Summary
FieldsFields inherited from class net.schmizz.sshj.xfer.scp.AbstractSCPClient
bandwidthLimit, engine
-
Constructor Summary
ConstructorsConstructorDescriptionSCPDownloadClient
(SCPEngine engine) SCPDownloadClient
(SCPEngine engine, int bandwidthLimit) -
Method Summary
Modifier and TypeMethodDescriptionint
copy
(String sourcePath, LocalDestFile targetFile) Download a file fromsourcePath
on the connected host totargetPath
locally.int
copy
(String sourcePath, LocalDestFile targetFile, ScpCommandLine.EscapeMode escapeMode) int
copy
(String sourcePath, LocalDestFile targetFile, ScpCommandLine.EscapeMode escapeMode, ScpCommandLine commandLine) boolean
private long
private int
parsePermissions
(String cmd) private boolean
process
(TransferListener listener, String bufferedTMsg, String msg, LocalDestFile f) private void
processDirectory
(TransferListener listener, String dMsg, String tMsg, LocalDestFile f) private void
processFile
(TransferListener listener, String cMsg, String tMsg, LocalDestFile f) private void
setAttributes
(LocalDestFile f, int perms, String tMsg) void
setRecursiveMode
(boolean recursive) private void
startCopy
(LocalDestFile targetFile, ScpCommandLine commandLine)
-
Field Details
-
recursiveMode
private boolean recursiveMode
-
-
Constructor Details
-
Method Details
-
copy
Download a file fromsourcePath
on the connected host totargetPath
locally.- Throws:
IOException
-
copy
public int copy(String sourcePath, LocalDestFile targetFile, ScpCommandLine.EscapeMode escapeMode) throws IOException - Throws:
IOException
-
copy
public int copy(String sourcePath, LocalDestFile targetFile, ScpCommandLine.EscapeMode escapeMode, ScpCommandLine commandLine) throws IOException - Throws:
IOException
-
getRecursiveMode
public boolean getRecursiveMode() -
setRecursiveMode
public void setRecursiveMode(boolean recursive) -
startCopy
- Throws:
IOException
-
parseLong
- Throws:
SCPException
-
parsePermissions
- Throws:
SCPException
-
process
private boolean process(TransferListener listener, String bufferedTMsg, String msg, LocalDestFile f) throws IOException - Throws:
IOException
-
processDirectory
private void processDirectory(TransferListener listener, String dMsg, String tMsg, LocalDestFile f) throws IOException - Throws:
IOException
-
processFile
private void processFile(TransferListener listener, String cMsg, String tMsg, LocalDestFile f) throws IOException - Throws:
IOException
-
setAttributes
- Throws:
IOException
-
tokenize
private static List<String> tokenize(String msg, int totalParts, boolean consolidateTail) throws IOException - Throws:
IOException
-