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 class for all regular expression based FTPFileEntryParser classes
- Steve Cohen <firstname.lastname@example.org>
internal pattern the matcher tries to match, representing a file
internal match result used by the parser
Internal PatternMatcher object used by the parser. It has protected
scope in case subclasses want to make use of it for their own purposes.
The constructor for a RegexFTPFileEntryParserImpl object.
regex The regular expression with which this object is
Thrown if the regular expression is unparseable. Should not be seen in
normal conditions. It it is seen, this is a sign that a subclass has
been created with a bad regular expression. Since the parser must be
created before use, this means that any bad parser subclasses created
from this will bomb very quickly, leading to easy detection.
Convenience method delegates to the internal MatchResult's matches()
s the String to be matched
- true if s matches this object's regular expression.
- the number of groups() in the internal MatchResult.
Convenience method delegates to the internal MatchResult's group()
matchnum match group number to be retrieved
- the content of the
matchnum'th group of the internal
match or null if this method is called without a match having
For debugging purposes - returns a string shows each match group by
- a string shows each match group by number.
Alter the current regular expression being utilised for entry parsing
and create a new
regex The new regular expression
- PatternSyntaxException if the regex cannot be compiled