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