org.apache.commons.net.ftp.parser
Class RegexFTPFileEntryParserImpl
FTPFileEntryParserImpl
org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
public abstract class RegexFTPFileEntryParserImpl
extends FTPFileEntryParserImpl
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
protected Matcher | _matcher_ - Internal PatternMatcher object used by the parser.
|
int | getGroupCnt() - Convenience method
|
String | getGroupsAsString() - For debugging purposes - returns a string shows each match group by
number.
|
String | group(int matchnum) - Convenience method delegates to the internal MatchResult's group()
method.
|
boolean | matches(String s) - Convenience method delegates to the internal MatchResult's matches()
method.
|
boolean | setRegex(String regex) - Alter the current regular expression being utilised for entry parsing
and create a new
Pattern instance.
|
_matcher_
protected Matcher _matcher_
Internal PatternMatcher object used by the parser. It has protected
scope in case subclasses want to make use of it for their own purposes.
RegexFTPFileEntryParserImpl
public RegexFTPFileEntryParserImpl(String regex)
The constructor for a RegexFTPFileEntryParserImpl object.
regex
- The regular expression with which this object is
initialized.
getGroupCnt
public int getGroupCnt()
Convenience method
- the number of groups() in the internal MatchResult.
getGroupsAsString
public String getGroupsAsString()
For debugging purposes - returns a string shows each match group by
number.
- a string shows each match group by number.
group
public String group(int matchnum)
Convenience method delegates to the internal MatchResult's group()
method.
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
been made.
matches
public boolean matches(String s)
Convenience method delegates to the internal MatchResult's matches()
method.
s
- the String to be matched
- true if s matches this object's regular expression.
setRegex
public boolean setRegex(String regex)
Alter the current regular expression being utilised for entry parsing
and create a new Pattern
instance.
regex
- The new regular expression