Class VMSVersioningFTPEntryParser
- java.lang.Object
-
- org.apache.commons.net.ftp.FTPFileEntryParserImpl
-
- org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
-
- org.apache.commons.net.ftp.parser.ConfigurableFTPFileEntryParserImpl
-
- org.apache.commons.net.ftp.parser.VMSFTPEntryParser
-
- 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 file name.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)",
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternPATTERNprivate static java.lang.StringREGEXGuard against polynomial regular expression used on uncontrolled data.-
Fields inherited from class org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
_matcher_
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisVersioning()Returnsfalse.java.util.List<java.lang.String>preParse(java.util.List<java.lang.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, setRegex
-
-
-
-
Field Detail
-
REGEX
private static final java.lang.String REGEX
Guard against polynomial regular expression used on uncontrolled data. Don't look for more than 20 digits for the version. Don't look for more than 80 spaces after the version. Don't look for more than 80 characters after the spaces.- See Also:
- Constant Field Values
-
PATTERN
private static final java.util.regex.Pattern PATTERN
-
-
Constructor Detail
-
VMSVersioningFTPEntryParser
public VMSVersioningFTPEntryParser()
Constructor for a VMSFTPEntryParser object.- Throws:
java.lang.IllegalArgumentException- Thrown if the regular expression is unparseable. Should not be seen under normal conditions. If the exception is seen, this is a sign thatREGEXis 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- Theconfigurationobject used to configure this parser.- Throws:
java.lang.IllegalArgumentException- Thrown if the regular expression is unparseable. Should not be seen under normal conditions. If the exception is seen, this is a sign thatREGEXis not a valid regular expression.- Since:
- 1.4
-
-
Method Detail
-
isVersioning
protected boolean isVersioning()
Description copied from class:VMSFTPEntryParserReturnsfalse.- Overrides:
isVersioningin classVMSFTPEntryParser- Returns:
false.
-
preParse
public java.util.List<java.lang.String> preParse(java.util.List<java.lang.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:
preParsein interfaceFTPFileEntryParser- Overrides:
preParsein classFTPFileEntryParserImpl- Parameters:
original- Original list- Returns:
- Original list purged of duplicates
-
-