Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.net.ftp
Class FTPFileList  view FTPFileList download FTPFileList.java

java.lang.Object
  extended byorg.apache.commons.net.ftp.FTPFileList

Deprecated. This class is deprecated as of version 1.2 and will be removed in version 2.0 -- use FTPFileParseEngine instead.

public class FTPFileList
extends java.lang.Object

This class encapsulates a listing of files from an FTP server. It is initialized with an input stream which is read and the input split into lines, each of which (after some possible initial verbiage) represents a file on the FTP server. A parser is also supplied, which is used to iterate through the internal list of lines parsing each into an FTPFile object which is returned to the caller of the iteration methods. This parser may be replaced with another, allowing the same list to be parsed with different parsers. Parsing takes place on an as-needed basis, basically, the first time a position is iterated over. This happens at the time of iteration, not prior to it as the older (FTPClient.listFiles() methods did, which required a bigger memory hit.

Version:
$Id: FTPFileList.java 165675 2005-05-02 20:09:55Z rwinston $

Field Summary
private static int EMPTY_DIR
          Deprecated. private status code for an empty directory
private  java.util.LinkedList lines
          Deprecated. storage for the raw lines of input read from the FTP server
private  FTPFileEntryParser parser
          Deprecated. the FTPFileEntryParser assigned to be used with this lister
 
Constructor Summary
private FTPFileList(FTPFileEntryParser parser, java.lang.String encoding)
          Deprecated. The only constructor for FTPFileList, private because construction only invoked at create()
 
Method Summary
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
(package private)  java.util.List getLines()
          Deprecated. Package private accessor for the collection of raw input lines.
(package private)  FTPFileEntryParser getParser()
          Deprecated. Accessor for this object's default parser.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lines

private java.util.LinkedList lines
Deprecated. 
storage for the raw lines of input read from the FTP server


parser

private FTPFileEntryParser parser
Deprecated. 
the FTPFileEntryParser assigned to be used with this lister


EMPTY_DIR

private static final int EMPTY_DIR
Deprecated. 
private status code for an empty directory

See Also:
Constant Field Values
Constructor Detail

FTPFileList

private FTPFileList(FTPFileEntryParser parser,
                    java.lang.String encoding)
Deprecated. 
The only constructor for FTPFileList, private because construction only invoked at create()

Method Detail

create

public static FTPFileList create(java.io.InputStream stream,
                                 FTPFileEntryParser parser,
                                 java.lang.String encoding)
                          throws java.io.IOException
Deprecated. 
The only way to create an 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.


create

public static FTPFileList create(java.io.InputStream stream,
                                 FTPFileEntryParser parser)
                          throws java.io.IOException
Deprecated. The version of this method which takes an encoding should be used.

The only way to create an 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.


readStream

public void readStream(java.io.InputStream stream,
                       java.lang.String encoding)
                throws java.io.IOException
Deprecated. 
internal method for reading the input into the lines vector.


readStream

public void readStream(java.io.InputStream stream)
                throws java.io.IOException
Deprecated. The version of this method which takes an encoding should be used.

internal method for reading the input into the lines vector.


getParser

FTPFileEntryParser getParser()
Deprecated. 
Accessor for this object's default parser.


getLines

java.util.List getLines()
Deprecated. 
Package private accessor for the collection of raw input lines.


iterator

public FTPFileIterator iterator()
Deprecated. 
create an iterator over this list using the parser with which this list was initally created


iterator

public FTPFileIterator iterator(FTPFileEntryParser parser)
Deprecated. 
create an iterator over this list using the supplied parser


getFiles

public FTPFile[] getFiles()
Deprecated. 
returns an array of FTPFile objects for all the files in the directory listing