org.apache.commons.net.ftp.parser

Class CompositeFileEntryParser

Implemented Interfaces:
FTPFileEntryParser, FTPFileListParser

public class CompositeFileEntryParser
extends FTPFileEntryParserImpl

This implementation allows to pack some FileEntryParsers together and handle the case where to returned dirstyle isnt clearly defined. The matching parser will be cached. If the cached parser wont match due to the server changed the dirstyle, a new matching parser will be searched.

Author:
Mario Ivankovits

Field Summary

private FTPFileEntryParser
cachedFtpFileEntryParser
private FTPFileEntryParser[]
ftpFileEntryParsers

Constructor Summary

CompositeFileEntryParser(FTPFileEntryParser[] ftpFileEntryParsers)

Method Summary

FTPFile
parseFTPEntry(String listEntry)

Methods inherited from class org.apache.commons.net.ftp.FTPFileEntryParserImpl

parseFileList, preParse, readNextEntry

Field Details

cachedFtpFileEntryParser

private FTPFileEntryParser cachedFtpFileEntryParser


ftpFileEntryParsers

private final FTPFileEntryParser[] ftpFileEntryParsers

Constructor Details

CompositeFileEntryParser

public CompositeFileEntryParser(FTPFileEntryParser[] ftpFileEntryParsers)

Method Details

parseFTPEntry

public FTPFile parseFTPEntry(String listEntry)
Specified by:
parseFTPEntry in interface FTPFileEntryParser