FTPFileEntryParserImplpublic abstract class FTPFileEntryParserImpl extends Object implements FTPFileListParser, FTPFileEntryParserThis abstract class implements both the older FTPFileListParser and
newer FTPFileEntryParser interfaces with default functionality.
All the classes in the parser subpackage inherit from this. |
Constructors Summary |
---|
public FTPFileEntryParserImpl()The constructor for a FTPFileEntryParserImpl object.
|
Methods Summary |
---|
public FTPFile[] | parseFileList(java.io.InputStream listStream, java.lang.String encoding)Parses an FTP server file listing and converts it into a usable format
in the form of an array of FTPFile instances. If the
file list contains no files, null should be
returned, otherwise an array of FTPFile instances
representing the files in the directory is returned.
FTPFileList ffl = FTPFileList.create(listStream, this, encoding);
return ffl.getFiles();
| public FTPFile[] | parseFileList(java.io.InputStream listStream)Parses an FTP server file listing and converts it into a usable format
in the form of an array of FTPFile instances. If the
file list contains no files, null should be
returned, otherwise an array of FTPFile instances
representing the files in the directory is returned.
return parseFileList(listStream, null);
| public java.util.List | preParse(java.util.List original)This method is a hook for those implementors (such as
VMSVersioningFTPEntryParser, and possibly others) which need to
perform some action upon the FTPFileList after it has been created
from the server stream, but before any clients see the list.
This default implementation is a no-op.
Iterator it = original.iterator();
while (it.hasNext()){
String entry = (String) it.next();
if (null == parseFTPEntry(entry)) {
it.remove();
} else {
break;
}
}
return original;
| public java.lang.String | readNextEntry(java.io.BufferedReader reader)Reads the next entry using the supplied BufferedReader object up to
whatever delemits one entry from the next. This default implementation
simply calls BufferedReader.readLine().
return reader.readLine();
|
|