Package com.enterprisedt.net.ftp.ssh
Class AbstractSFTPInputStream
java.lang.Object
java.io.InputStream
com.enterprisedt.net.ftp.FileTransferInputStream
com.enterprisedt.net.ftp.ssh.AbstractSFTPInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Represents an input stream of bytes coming from an FTP server, permitting
the user to download a file by reading the stream. It can only be used
for one download, i.e. after the stream is closed it cannot be reopened.
- Version:
- $Revision$
- Author:
- Bruce Blackshaw
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SSHFTPClientThe client being used to perform the transferprotected com.enterprisedt.net.j2ssh.sftp.SftpFileInputStreamprotected com.enterprisedt.net.j2ssh.SftpClientImplementation objectFields inherited from class com.enterprisedt.net.ftp.FileTransferInputStream
closed, monitor, monitorCount, monitorEx, monitorInterval, pos, remoteFile, started -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSFTPInputStream(SSHFTPClient client, String remoteFile) Constructor. -
Method Summary
Methods inherited from class com.enterprisedt.net.ftp.FileTransferInputStream
checkMonitor, getRemoteFile, setMonitorMethods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
client
The client being used to perform the transfer -
sftp
protected com.enterprisedt.net.j2ssh.SftpClient sftpImplementation object -
in
protected com.enterprisedt.net.j2ssh.sftp.SftpFileInputStream in
-
-
Constructor Details
-
AbstractSFTPInputStream
public AbstractSFTPInputStream(SSHFTPClient client, String remoteFile) throws IOException, FTPException Constructor. A connected FTPClient instance must be supplied. This sets up the download. If an offset > 0 is supplied, must be a binary transfer.- Parameters:
client- connected FTPClient instanceremoteFile- remote file- Throws:
IOExceptionFTPException
-
-
Method Details
-
start
- Throws:
IOException
-
start
Start the transfer- Throws:
IOException
-
close
Closes this input stream and releases any system resources associated with the stream. This must be called before any other operations are initiated on the FTPClient.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- if an I/O error occurs.
-