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:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
GridFTPInputStream
public class FTPInputStream extends GlobusInputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected FTPClient
ftp
protected java.io.InputStream
input
protected TransferState
state
-
Constructor Summary
Constructors Modifier Constructor Description protected
FTPInputStream()
FTPInputStream(java.lang.String host, int port, java.lang.String user, java.lang.String pwd, java.lang.String file)
FTPInputStream(java.lang.String host, int port, java.lang.String user, java.lang.String pwd, java.lang.String file, boolean passive, int type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
Aborts transfer.int
available()
void
close()
protected void
get(boolean passive, int type, java.lang.String remoteFile)
long
getSize()
Returns the total size of input data.int
read()
int
read(byte[] msg)
int
read(byte[] buf, int off, int len)
-
-
-
Field Detail
-
input
protected java.io.InputStream input
-
ftp
protected FTPClient ftp
-
state
protected TransferState state
-
-
Constructor Detail
-
FTPInputStream
protected FTPInputStream()
-
FTPInputStream
public FTPInputStream(java.lang.String host, int port, java.lang.String user, java.lang.String pwd, java.lang.String file) throws java.io.IOException, FTPException
- Throws:
java.io.IOException
FTPException
-
FTPInputStream
public FTPInputStream(java.lang.String host, int port, java.lang.String user, java.lang.String pwd, java.lang.String file, boolean passive, int type) throws java.io.IOException, FTPException
- Throws:
java.io.IOException
FTPException
-
-
Method Detail
-
get
protected void get(boolean passive, int type, java.lang.String remoteFile) throws java.io.IOException, FTPException
- Throws:
java.io.IOException
FTPException
-
getSize
public long getSize()
Description copied from class:GlobusInputStream
Returns the total size of input data.- Overrides:
getSize
in classGlobusInputStream
- Returns:
- -1 if size is unknown.
-
abort
public void abort()
Description copied from class:GlobusInputStream
Aborts transfer. Usually makes sure to release all resources (sockets, file descriptors)
Does nothing by default.- Overrides:
abort
in classGlobusInputStream
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] msg) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] buf, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException
- Overrides:
read
in classGlobusInputStream
- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-