public class FTPFileList
extends java.lang.Object
(FTPClient.listFiles()
methods did,
which required a bigger memory hit.FTPClient.createFileList(org.apache.commons.net.ftp.FTPFileEntryParser)
,
FTPFileIterator
,
FTPFileEntryParser
,
FTPListParseEngine
Modifier and Type | Method and Description |
---|---|
static FTPFileList |
create(java.io.InputStream stream,
FTPFileEntryParser parser)
Deprecated.
The version of this method which takes an encoding should be used.
|
static FTPFileList |
create(java.io.InputStream stream,
FTPFileEntryParser parser,
java.lang.String encoding)
Deprecated.
The only way to create an
FTPFileList object. |
FTPFile[] |
getFiles()
Deprecated.
returns an array of FTPFile objects for all the files in the directory
listing
|
FTPFileIterator |
iterator()
Deprecated.
create an iterator over this list using the parser with which this list
was initally created
|
FTPFileIterator |
iterator(FTPFileEntryParser parser)
Deprecated.
create an iterator over this list using the supplied parser
|
void |
readStream(java.io.InputStream stream)
Deprecated.
The version of this method which takes an encoding should be used.
|
void |
readStream(java.io.InputStream stream,
java.lang.String encoding)
Deprecated.
internal method for reading the input into the
lines vector. |
public static FTPFileList create(java.io.InputStream stream, FTPFileEntryParser parser, java.lang.String encoding) throws java.io.IOException
FTPFileList
object. Invokes
the private constructor and then reads the stream supplied stream to
build the intermediate array of "lines" which will later be parsed
into FTPFile
object.stream
- The input stream created by reading the socket on which
the output of the LIST command was returnedparser
- the default FTPFileEntryParser
to be used
by this object. This may later be changed using the init() method.encoding
- The encoding to useFTPFileList
created, with an initialized
of unparsed lines of output. Will be null if the listing cannot
be read from the stream.java.io.IOException
- Thrown on any failure to read from the socket.public static FTPFileList create(java.io.InputStream stream, FTPFileEntryParser parser) throws java.io.IOException
FTPFileList
object. Invokes
the private constructor and then reads the stream supplied stream to
build the intermediate array of "lines" which will later be parsed
into FTPFile
object.stream
- The input stream created by reading the socket on which
the output of the LIST command was returnedparser
- the default FTPFileEntryParser
to be used
by this object. This may later be changed using the init() method.FTPFileList
created, with an initialized
of unparsed lines of output. Will be null if the listing cannot
be read from the stream.java.io.IOException
- Thrown on any failure to read from the socket.public void readStream(java.io.InputStream stream, java.lang.String encoding) throws java.io.IOException
lines
vector.stream
- The socket stream on which the input will be read.encoding
- The encoding to use.java.io.IOException
- thrown on any failure to read the streampublic void readStream(java.io.InputStream stream) throws java.io.IOException
lines
vector.stream
- The socket stream on which the input will be read.java.io.IOException
- thrown on any failure to read the streampublic FTPFileIterator iterator()
public FTPFileIterator iterator(FTPFileEntryParser parser)
parser
- The user-supplied parser with which the list is to be
iterated, may be different from this list's default parser.public FTPFile[] getFiles()