This abstract class implements both the older FTPFileListParser and
newer FTPFileEntryParser interfaces with default functionality.
All the classes in the parser subpackage inherit from this.
This is the base for all regular based FTPFileEntryParser
author: Steve Cohen
Field Summary
protected PatternMatcher
_matcher_ Internal PatternMatcher object used by the parser.
Constructor Summary
public
RegexFTPFileEntryParserImpl(String regex) The constructor for a RegexFTPFileEntryParserImpl object.
Parameters: regex - The regular expression with which this object isinitialized. exception: IllegalArgumentException - Thrown if the regular expression is unparseable.
Method Summary
public int
getGroupCnt() Convenience method delegates to the internal MatchResult's groups()
method.
Internal PatternMatcher object used by the parser. It has protected
scope in case subclasses want to make use of it for their own purposes.
Constructor Detail
RegexFTPFileEntryParserImpl
public RegexFTPFileEntryParserImpl(String regex)(Code)
The constructor for a RegexFTPFileEntryParserImpl object.
Parameters: regex - The regular expression with which this object isinitialized. exception: IllegalArgumentException - Thrown if the regular expression is unparseable. Should not be seen innormal conditions. It it is seen, this is a sign that a subclass hasbeen created with a bad regular expression. Since the parser must becreated before use, this means that any bad parser subclasses createdfrom this will bomb very quickly, leading to easy detection.
Convenience method delegates to the internal MatchResult's group()
method.
Parameters: matchnum - match group number to be retrieved the content of the matchnum'th group of the internalmatch or null if this method is called without a match havingbeen made.
Convenience method delegates to the internal MatchResult's matches()
method.
Parameters: s - the String to be matched true if s matches this object's regular expression.
Methods inherited from org.apache.commons.net.ftp.FTPFileEntryParserImpl