org.apache.commons.net.ftp.parser

Class VMSVersioningFTPEntryParser

Implemented Interfaces:
FTPFileEntryParser, FTPFileListParser

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,v 1.8 2004/04/22 00:48:07 scohen Exp $

Authors:
Winston Ojeda
Steve Cohen
Stephane ESTE-GRACIAS

See Also:
FTPFileEntryParser (for usage instructions)

Nested Class Summary

private class
VMSVersioningFTPEntryParser.NameVersion

Field Summary

private static String
PRE_PARSE_REGEX
private Perl5Matcher
_preparse_matcher_
private Pattern
_preparse_pattern_

Fields inherited from class org.apache.commons.net.ftp.parser.VMSFTPEntryParser

MONTHS, REGEX

Fields inherited from class org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl

_matcher_, pattern, result

Constructor Summary

VMSVersioningFTPEntryParser()
Constructor for a VMSFTPEntryParser object.

Method Summary

protected boolean
isVersioning()
List
preParse(List 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

isVersioning, parseFTPEntry, parseFileList, readNextEntry

Methods inherited from class org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl

getGroupCnt, getGroupsAsString, group, matches

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

parseFileList, preParse, readNextEntry

Field Details

PRE_PARSE_REGEX

private static final String PRE_PARSE_REGEX


_preparse_matcher_

private Perl5Matcher _preparse_matcher_


_preparse_pattern_

private Pattern _preparse_pattern_

Constructor Details

VMSVersioningFTPEntryParser

public VMSVersioningFTPEntryParser()
Constructor for a VMSFTPEntryParser object. Sets the versioning member to the supplied value.

Method Details

isVersioning

protected boolean isVersioning()
Overrides:
isVersioning in interface VMSFTPEntryParser


preParse

public List preParse(List 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 interface FTPFileEntryParserImpl

Parameters:
original - Original list

Returns:
Original list purged of duplicates