Package org.globus.io.streams
Class FTPInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.globus.io.streams.GlobusInputStream
-
- org.globus.io.streams.FTPInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
GridFTPInputStream
public class FTPInputStream extends GlobusInputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected FTPClientftpprotected InputStreaminputprotected TransferStatestate
-
Constructor Summary
Constructors Modifier Constructor Description protectedFTPInputStream()FTPInputStream(String host, int port, String user, String pwd, String file)FTPInputStream(String host, int port, String user, String pwd, String file, boolean passive, int type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()Aborts transfer.intavailable()voidclose()protected voidget(boolean passive, int type, String remoteFile)longgetSize()Returns the total size of input data.intread()intread(byte[] msg)intread(byte[] buf, int off, int len)-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Field Detail
-
input
protected InputStream input
-
ftp
protected FTPClient ftp
-
state
protected TransferState state
-
-
Constructor Detail
-
FTPInputStream
protected FTPInputStream()
-
FTPInputStream
public FTPInputStream(String host, int port, String user, String pwd, String file) throws IOException, FTPException
- Throws:
IOExceptionFTPException
-
FTPInputStream
public FTPInputStream(String host, int port, String user, String pwd, String file, boolean passive, int type) throws IOException, FTPException
- Throws:
IOExceptionFTPException
-
-
Method Detail
-
get
protected void get(boolean passive, int type, String remoteFile) throws IOException, FTPException- Throws:
IOExceptionFTPException
-
getSize
public long getSize()
Description copied from class:GlobusInputStreamReturns the total size of input data.- Overrides:
getSizein classGlobusInputStream- Returns:
- -1 if size is unknown.
-
abort
public void abort()
Description copied from class:GlobusInputStreamAborts transfer. Usually makes sure to release all resources (sockets, file descriptors)
Does nothing by default.- Overrides:
abortin classGlobusInputStream
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
public int read(byte[] msg) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read() throws IOException- Overrides:
readin classGlobusInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
-