Class ConfigurableFTPFileEntryParserImpl

All Implemented Interfaces:
Configurable, FTPFileEntryParser
Direct Known Subclasses:
MacOsPeterFTPEntryParser, MVSFTPEntryParser, NetwareFTPEntryParser, NTFTPEntryParser, OS2FTPEntryParser, OS400FTPEntryParser, UnixFTPEntryParser, VMSFTPEntryParser

This abstract class implements the common timestamp parsing algorithm for all the concrete parsers. Classes derived from this one will parse file listings via a supplied regular expression that pulls out the date portion as a separate string which is passed to the underlying delegate to handle parsing of the file timestamp.

This class also implements the Configurable interface to allow the parser to be configured from the outside.

Since:
1.4
  • Constructor Details

  • Method Details

    • configure

      public void configure(FTPClientConfig config)
      Implements the Configurable interface. Configures this parser by delegating to the underlying Configurable FTPTimestampParser implementation, ' passing it the supplied FTPClientConfig if that is non-null or a default configuration defined by each concrete subclass.
      Specified by:
      configure in interface Configurable
      Parameters:
      config - the configuration to be used to configure this parser. If it is null, a default configuration defined by each concrete subclass is used instead.
    • getDefaultConfiguration

      Each concrete subclass must define this member to create a default configuration to be used when that subclass is instantiated without a FTPClientConfig parameter being specified.
      Returns:
      the default configuration for the subclass.
    • parseTimestamp

      public Calendar parseTimestamp(String timestampStr) throws ParseException
      This method is called by the concrete parsers to delegate timestamp parsing to the timestamp parser.
      Parameters:
      timestampStr - the timestamp string pulled from the file listing by the regular expression parser, to be submitted to the timestampParser for extracting the timestamp.
      Returns:
      a java.util.Calendar containing results of the timestamp parse.
      Throws:
      ParseException - on parse error