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 LocalFileFilter
uploadFilter
-
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 int
copy(LocalSourceFile sourceFile, java.lang.String remotePath)
Upload a local file fromlocalFile
totargetPath
on the remote host.int
copy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode)
int
copy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode, boolean preserveTimes)
int
copy(LocalSourceFile sourceFile, java.lang.String remotePath, ScpCommandLine.EscapeMode escapeMode, ScpCommandLine commandLine)
private java.lang.String
getPermString(LocalSourceFile f)
private void
preserveTimeIfPossible(LocalSourceFile f)
private void
process(TransferListener listener, LocalSourceFile f, boolean preserveTimes)
private void
sendDirectory(TransferListener listener, LocalSourceFile f, boolean preserveTimes)
private void
sendFile(StreamCopier.Listener listener, LocalSourceFile f, boolean preserveTimes)
void
setUploadFilter(LocalFileFilter uploadFilter)
private void
startCopy(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 fromlocalFile
totargetPath
on 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
-
-