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 intbandwidthLimitprivate static intDEFAULT_BANDWIDTH_LIMITDefault bandwidth limit for SCP transfer in kilobit/s (-1 means unlimited)private SessionFactorysessionFactory-
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 SCPFileTransferbandwidthLimit(int limit)private voidcheckByteOffsetSupport(long byteOffset)voiddownload(java.lang.String remotePath, java.lang.String localPath)This is meant to delegate toFileTransfer.download(String, LocalDestFile)with thelocalPathwrapped as e.g.voiddownload(java.lang.String remotePath, java.lang.String localPath, long byteOffset)This is meant to delegate toFileTransfer.download(String, LocalDestFile)with thelocalPathwrapped as e.g.voiddownload(java.lang.String remotePath, LocalDestFile localFile)DownloadremotePathtolocalFile.voiddownload(java.lang.String remotePath, LocalDestFile localFile, long byteOffset)DownloadremotePathtolocalFile.SCPDownloadClientnewSCPDownloadClient()private SCPEnginenewSCPEngine()SCPUploadClientnewSCPUploadClient()voidupload(java.lang.String localPath, java.lang.String remotePath)This is meant to delegate toFileTransfer.upload(LocalSourceFile, String)with thelocalPathwrapped as e.g.voidupload(java.lang.String localFile, java.lang.String remotePath, long byteOffset)This is meant to delegate toFileTransfer.upload(LocalSourceFile, String)with thelocalPathwrapped as e.g.voidupload(LocalSourceFile localFile, java.lang.String remotePath)UploadlocalFiletoremotePath.voidupload(LocalSourceFile localFile, java.lang.String remotePath, long byteOffset)UploadlocalFiletoremotePath.-
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.IOExceptionDescription copied from interface:FileTransferThis is meant to delegate toFileTransfer.upload(LocalSourceFile, String)with thelocalPathwrapped as e.g. aFileSystemFile.- Specified by:
uploadin interfaceFileTransfer- Throws:
java.io.IOException
-
upload
public void upload(java.lang.String localFile, java.lang.String remotePath, long byteOffset) throws java.io.IOExceptionDescription copied from interface:FileTransferThis is meant to delegate toFileTransfer.upload(LocalSourceFile, String)with thelocalPathwrapped as e.g. aFileSystemFile. Appends to existing ifbyteOffset> 0.- Specified by:
uploadin interfaceFileTransfer- Throws:
java.io.IOException
-
download
public void download(java.lang.String remotePath, java.lang.String localPath) throws java.io.IOExceptionDescription copied from interface:FileTransferThis is meant to delegate toFileTransfer.download(String, LocalDestFile)with thelocalPathwrapped as e.g. aFileSystemFile.- Specified by:
downloadin interfaceFileTransfer- Throws:
java.io.IOException
-
download
public void download(java.lang.String remotePath, java.lang.String localPath, long byteOffset) throws java.io.IOExceptionDescription copied from interface:FileTransferThis is meant to delegate toFileTransfer.download(String, LocalDestFile)with thelocalPathwrapped as e.g. aFileSystemFile. Appends to existing ifbyteOffset> 0.- Specified by:
downloadin interfaceFileTransfer- Throws:
java.io.IOException
-
download
public void download(java.lang.String remotePath, LocalDestFile localFile) throws java.io.IOExceptionDescription copied from interface:FileTransferDownloadremotePathtolocalFile.- Specified by:
downloadin interfaceFileTransfer- Throws:
java.io.IOException
-
download
public void download(java.lang.String remotePath, LocalDestFile localFile, long byteOffset) throws java.io.IOExceptionDescription copied from interface:FileTransferDownloadremotePathtolocalFile. Appends to existing ifbyteOffset> 0.- Specified by:
downloadin interfaceFileTransfer- Throws:
java.io.IOException
-
upload
public void upload(LocalSourceFile localFile, java.lang.String remotePath) throws java.io.IOException
Description copied from interface:FileTransferUploadlocalFiletoremotePath.- Specified by:
uploadin 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:FileTransferUploadlocalFiletoremotePath. Appends to existing ifbyteOffset> 0.- Specified by:
uploadin 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
-
-