Package net.schmizz.sshj.xfer.scp
Class SCPUploadClient
- java.lang.Object
-
- net.schmizz.sshj.xfer.scp.AbstractSCPClient
-
- net.schmizz.sshj.xfer.scp.SCPUploadClient
-
public class SCPUploadClient extends AbstractSCPClient
Support for uploading files over a connected link using SCP.
-
-
Field Summary
Fields Modifier and Type Field Description private LocalFileFilteruploadFilter-
Fields inherited from class net.schmizz.sshj.xfer.scp.AbstractSCPClient
bandwidthLimit, engine
-
-
Constructor Summary
Constructors Constructor Description SCPUploadClient(SCPEngine engine)SCPUploadClient(SCPEngine engine, int bandwidthLimit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcopy(LocalSourceFile sourceFile, java.lang.String remotePath)Upload a local file fromlocalFiletotargetPathon the remote host.intcopy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode)intcopy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode, boolean preserveTimes)intcopy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode, ScpCommandLine commandLine)private java.lang.StringgetPermString(LocalSourceFile f)private voidpreserveTimeIfPossible(LocalSourceFile f)private voidprocess(TransferListener listener, LocalSourceFile f, boolean preserveTimes)private voidsendDirectory(TransferListener listener, LocalSourceFile f, boolean preserveTimes)private voidsendFile(StreamCopier.Listener listener, LocalSourceFile f, boolean preserveTimes)voidsetUploadFilter(LocalFileFilter uploadFilter)private voidstartCopy(LocalSourceFile sourceFile, ScpCommandLine commandLine)
-
-
-
Field Detail
-
uploadFilter
private LocalFileFilter uploadFilter
-
-
Method Detail
-
copy
public int copy(LocalSourceFile sourceFile, java.lang.String remotePath) throws java.io.IOException
Upload a local file fromlocalFiletotargetPathon the remote host.- Throws:
java.io.IOException
-
copy
public int copy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode) throws java.io.IOException
- Throws:
java.io.IOException
-
copy
public int copy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode, boolean preserveTimes) throws java.io.IOException
- Throws:
java.io.IOException
-
copy
public int copy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode, ScpCommandLine commandLine) throws java.io.IOException
- Throws:
java.io.IOException
-
setUploadFilter
public void setUploadFilter(LocalFileFilter uploadFilter)
-
startCopy
private void startCopy(LocalSourceFile sourceFile, ScpCommandLine commandLine) throws java.io.IOException
- Throws:
java.io.IOException
-
process
private void process(TransferListener listener, LocalSourceFile f, boolean preserveTimes) throws java.io.IOException
- Throws:
java.io.IOException
-
sendDirectory
private void sendDirectory(TransferListener listener, LocalSourceFile f, boolean preserveTimes) throws java.io.IOException
- Throws:
java.io.IOException
-
sendFile
private void sendFile(StreamCopier.Listener listener, LocalSourceFile f, boolean preserveTimes) throws java.io.IOException
- Throws:
java.io.IOException
-
preserveTimeIfPossible
private void preserveTimeIfPossible(LocalSourceFile f) throws java.io.IOException
- Throws:
java.io.IOException
-
getPermString
private java.lang.String getPermString(LocalSourceFile f) throws java.io.IOException
- Throws:
java.io.IOException
-
-