org.apache.commons.net.ftp.parser
Class VMSVersioningFTPEntryParser

java.lang.Object
  extended by org.apache.commons.net.ftp.FTPFileEntryParserImpl
      extended by org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
          extended by org.apache.commons.net.ftp.parser.ConfigurableFTPFileEntryParserImpl
              extended by org.apache.commons.net.ftp.parser.VMSFTPEntryParser
                  extended by org.apache.commons.net.ftp.parser.VMSVersioningFTPEntryParser
All Implemented Interfaces:
Configurable, FTPFileEntryParser

public class VMSVersioningFTPEntryParser
extends VMSFTPEntryParser

Special implementation VMSFTPEntryParser with versioning turned on. This parser removes all duplicates and only leaves the version with the highest version number for each filename. This is a sample of VMS LIST output "1-JUN.LIS;1 9/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)", "1-JUN.LIS;2 9/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)", "DATA.DIR;1 1/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)",

Version:
$Id: VMSVersioningFTPEntryParser.java 1299238 2012-03-10 17:12:28Z sebb $
Author:
Winston Ojeda, Stephane ESTE-GRACIAS
See Also:
FTPFileEntryParser (for usage instructions)

Field Summary
 
Fields inherited from class org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
_matcher_
 
Constructor Summary
VMSVersioningFTPEntryParser()
          Constructor for a VMSFTPEntryParser object.
VMSVersioningFTPEntryParser(FTPClientConfig config)
          This constructor allows the creation of a VMSVersioningFTPEntryParser object with something other than the default configuration.
 
Method Summary
protected  boolean isVersioning()
           
 List<String> preParse(List<String> original)
          Implement hook provided for those implementers (such as VMSVersioningFTPEntryParser, and possibly others) which return multiple files with the same name to remove the duplicates ..
 
Methods inherited from class org.apache.commons.net.ftp.parser.VMSFTPEntryParser
getDefaultConfiguration, parseFileList, parseFTPEntry, readNextEntry
 
Methods inherited from class org.apache.commons.net.ftp.parser.ConfigurableFTPFileEntryParserImpl
configure, parseTimestamp
 
Methods inherited from class org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
getGroupCnt, getGroupsAsString, group, matches, setRegex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMSVersioningFTPEntryParser

public VMSVersioningFTPEntryParser()
Constructor for a VMSFTPEntryParser object.

Throws:
IllegalArgumentException - Thrown if the regular expression is unparseable. Should not be seen under normal conditions. It it is seen, this is a sign that REGEX is not a valid regular expression.

VMSVersioningFTPEntryParser

public VMSVersioningFTPEntryParser(FTPClientConfig config)
This constructor allows the creation of a VMSVersioningFTPEntryParser object with something other than the default configuration.

Parameters:
config - The configuration object used to configure this parser.
Throws:
IllegalArgumentException - Thrown if the regular expression is unparseable. Should not be seen under normal conditions. It it is seen, this is a sign that REGEX is not a valid regular expression.
Since:
1.4
Method Detail

preParse

public List<String> preParse(List<String> original)
Implement hook provided for those implementers (such as VMSVersioningFTPEntryParser, and possibly others) which return multiple files with the same name to remove the duplicates ..

Specified by:
preParse in interface FTPFileEntryParser
Overrides:
preParse in class FTPFileEntryParserImpl
Parameters:
original - Original list
Returns:
Original list purged of duplicates

isVersioning

protected boolean isVersioning()
Overrides:
isVersioning in class VMSFTPEntryParser


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.