Class CompositeFileEntryParser
- java.lang.Object
-
- org.apache.commons.net.ftp.FTPFileEntryParserImpl
-
- org.apache.commons.net.ftp.parser.CompositeFileEntryParser
-
- All Implemented Interfaces:
FTPFileEntryParser
public class CompositeFileEntryParser extends FTPFileEntryParserImpl
This implementation allows to pack some FileEntryParsers together and handle the case where the returned dir style isn't clearly defined. The matching parser will be cached. If the cached parser won't match due to the server changed the dir style, a new matching parser will be searched.
-
-
Field Summary
Fields Modifier and Type Field Description private FTPFileEntryParser
cachedFtpFileEntryParser
private FTPFileEntryParser[]
ftpFileEntryParsers
-
Constructor Summary
Constructors Constructor Description CompositeFileEntryParser(FTPFileEntryParser[] ftpFileEntryParsers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FTPFile
parseFTPEntry(java.lang.String listEntry)
Parses a line of an FTP server file listing and converts it into a usable format in the form of anFTPFile
instance.-
Methods inherited from class org.apache.commons.net.ftp.FTPFileEntryParserImpl
preParse, readNextEntry
-
-
-
-
Field Detail
-
ftpFileEntryParsers
private final FTPFileEntryParser[] ftpFileEntryParsers
-
cachedFtpFileEntryParser
private FTPFileEntryParser cachedFtpFileEntryParser
-
-
Constructor Detail
-
CompositeFileEntryParser
public CompositeFileEntryParser(FTPFileEntryParser[] ftpFileEntryParsers)
-
-
Method Detail
-
parseFTPEntry
public FTPFile parseFTPEntry(java.lang.String listEntry)
Description copied from interface:FTPFileEntryParser
Parses a line of an FTP server file listing and converts it into a usable format in the form of anFTPFile
instance. If the file listing line doesn't describe a file,null
should be returned, otherwise aFTPFile
instance representing the files in the directory is returned.- Parameters:
listEntry
- A line of text from the file listing- Returns:
- An FTPFile instance corresponding to the supplied entry
-
-