Package net.schmizz.sshj.xfer.scp
Class SCPFileTransfer
- java.lang.Object
-
- net.schmizz.sshj.xfer.AbstractFileTransfer
-
- net.schmizz.sshj.xfer.scp.SCPFileTransfer
-
- All Implemented Interfaces:
FileTransfer
public class SCPFileTransfer extends AbstractFileTransfer implements FileTransfer
-
-
Field Summary
Fields Modifier and Type Field Description private int
bandwidthLimit
private static int
DEFAULT_BANDWIDTH_LIMIT
Default bandwidth limit for SCP transfer in kilobit/s (-1 means unlimited)private SessionFactory
sessionFactory
-
Fields inherited from class net.schmizz.sshj.xfer.AbstractFileTransfer
log, loggerFactory
-
-
Constructor Summary
Constructors Constructor Description SCPFileTransfer(SessionFactory sessionFactory, LoggerFactory loggerFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SCPFileTransfer
bandwidthLimit(int limit)
private void
checkByteOffsetSupport(long byteOffset)
void
download(java.lang.String remotePath, java.lang.String localPath)
This is meant to delegate toFileTransfer.download(String, LocalDestFile)
with thelocalPath
wrapped as e.g.void
download(java.lang.String remotePath, java.lang.String localPath, long byteOffset)
This is meant to delegate toFileTransfer.download(String, LocalDestFile)
with thelocalPath
wrapped as e.g.void
download(java.lang.String remotePath, LocalDestFile localFile)
DownloadremotePath
tolocalFile
.void
download(java.lang.String remotePath, LocalDestFile localFile, long byteOffset)
DownloadremotePath
tolocalFile
.SCPDownloadClient
newSCPDownloadClient()
private SCPEngine
newSCPEngine()
SCPUploadClient
newSCPUploadClient()
void
upload(java.lang.String localPath, java.lang.String remotePath)
This is meant to delegate toFileTransfer.upload(LocalSourceFile, String)
with thelocalPath
wrapped as e.g.void
upload(java.lang.String localFile, java.lang.String remotePath, long byteOffset)
This is meant to delegate toFileTransfer.upload(LocalSourceFile, String)
with thelocalPath
wrapped as e.g.void
upload(LocalSourceFile localFile, java.lang.String remotePath)
UploadlocalFile
toremotePath
.void
upload(LocalSourceFile localFile, java.lang.String remotePath, long byteOffset)
UploadlocalFile
toremotePath
.-
Methods inherited from class net.schmizz.sshj.xfer.AbstractFileTransfer
getTransferListener, setTransferListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.schmizz.sshj.xfer.FileTransfer
getTransferListener, setTransferListener
-
-
-
-
Field Detail
-
DEFAULT_BANDWIDTH_LIMIT
private static final int DEFAULT_BANDWIDTH_LIMIT
Default bandwidth limit for SCP transfer in kilobit/s (-1 means unlimited)- See Also:
- Constant Field Values
-
sessionFactory
private final SessionFactory sessionFactory
-
bandwidthLimit
private int bandwidthLimit
-
-
Constructor Detail
-
SCPFileTransfer
public SCPFileTransfer(SessionFactory sessionFactory, LoggerFactory loggerFactory)
-
-
Method Detail
-
newSCPDownloadClient
public SCPDownloadClient newSCPDownloadClient()
-
newSCPUploadClient
public SCPUploadClient newSCPUploadClient()
-
newSCPEngine
private SCPEngine newSCPEngine()
-
upload
public void upload(java.lang.String localPath, java.lang.String remotePath) throws java.io.IOException
Description copied from interface:FileTransfer
This is meant to delegate toFileTransfer.upload(LocalSourceFile, String)
with thelocalPath
wrapped as e.g. aFileSystemFile
.- Specified by:
upload
in interfaceFileTransfer
- Throws:
java.io.IOException
-
upload
public void upload(java.lang.String localFile, java.lang.String remotePath, long byteOffset) throws java.io.IOException
Description copied from interface:FileTransfer
This is meant to delegate toFileTransfer.upload(LocalSourceFile, String)
with thelocalPath
wrapped as e.g. aFileSystemFile
. Appends to existing ifbyteOffset
> 0.- Specified by:
upload
in interfaceFileTransfer
- Throws:
java.io.IOException
-
download
public void download(java.lang.String remotePath, java.lang.String localPath) throws java.io.IOException
Description copied from interface:FileTransfer
This is meant to delegate toFileTransfer.download(String, LocalDestFile)
with thelocalPath
wrapped as e.g. aFileSystemFile
.- Specified by:
download
in interfaceFileTransfer
- Throws:
java.io.IOException
-
download
public void download(java.lang.String remotePath, java.lang.String localPath, long byteOffset) throws java.io.IOException
Description copied from interface:FileTransfer
This is meant to delegate toFileTransfer.download(String, LocalDestFile)
with thelocalPath
wrapped as e.g. aFileSystemFile
. Appends to existing ifbyteOffset
> 0.- Specified by:
download
in interfaceFileTransfer
- Throws:
java.io.IOException
-
download
public void download(java.lang.String remotePath, LocalDestFile localFile) throws java.io.IOException
Description copied from interface:FileTransfer
DownloadremotePath
tolocalFile
.- Specified by:
download
in interfaceFileTransfer
- Throws:
java.io.IOException
-
download
public void download(java.lang.String remotePath, LocalDestFile localFile, long byteOffset) throws java.io.IOException
Description copied from interface:FileTransfer
DownloadremotePath
tolocalFile
. Appends to existing ifbyteOffset
> 0.- Specified by:
download
in interfaceFileTransfer
- Throws:
java.io.IOException
-
upload
public void upload(LocalSourceFile localFile, java.lang.String remotePath) throws java.io.IOException
Description copied from interface:FileTransfer
UploadlocalFile
toremotePath
.- Specified by:
upload
in interfaceFileTransfer
- Throws:
java.io.IOException
-
upload
public void upload(LocalSourceFile localFile, java.lang.String remotePath, long byteOffset) throws java.io.IOException
Description copied from interface:FileTransfer
UploadlocalFile
toremotePath
. Appends to existing ifbyteOffset
> 0.- Specified by:
upload
in interfaceFileTransfer
- Throws:
java.io.IOException
-
bandwidthLimit
public SCPFileTransfer bandwidthLimit(int limit)
-
checkByteOffsetSupport
private void checkByteOffsetSupport(long byteOffset) throws java.io.IOException
- Throws:
java.io.IOException
-
-