Package com.enterprisedt.net.ftp
Class AbstractFTPInputStream
java.lang.Object
java.io.InputStream
com.enterprisedt.net.ftp.FileTransferInputStream
com.enterprisedt.net.ftp.AbstractFTPInputStream
- 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 FTPClientThe client being used to perform the transferprotected BufferedInputStreamThe input stream from the FTP serverFields inherited from class com.enterprisedt.net.ftp.FileTransferInputStream
closed, monitor, monitorCount, monitorEx, monitorInterval, pos, remoteFile, started -
Constructor Summary
Constructors -
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 -
in
The input stream from the FTP server
-
-
Constructor Details
-
AbstractFTPInputStream
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.
-