Class RegexFTPFileEntryParserImpl
java.lang.Object
org.apache.commons.net.ftp.FTPFileEntryParserImpl
org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
- All Implemented Interfaces:
- FTPFileEntryParser
- Direct Known Subclasses:
- ConfigurableFTPFileEntryParserImpl,- EnterpriseUnixFTPEntryParser
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
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionThe constructor for a RegexFTPFileEntryParserImpl object.RegexFTPFileEntryParserImpl(String regex, int flags) The constructor for a RegexFTPFileEntryParserImpl object.
- 
Method SummaryModifier and TypeMethodDescriptionintConvenience methodFor debugging purposes - returns a string shows each match group by number.group(int matchNum) Convenience method delegates to the internal MatchResult's group() method.booleanConvenience method delegates to the internal MatchResult's matches() method.booleanAlter the current regular expression being utilised for entry parsing and create a newPatterninstance.booleanAlter the current regular expression being utilised for entry parsing and create a newPatterninstance.Methods inherited from class org.apache.commons.net.ftp.FTPFileEntryParserImplpreParse, readNextEntryMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.net.ftp.FTPFileEntryParserparseFTPEntry
- 
Field Details- 
_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.
 
- 
- 
Constructor Details- 
RegexFTPFileEntryParserImplThe constructor for a RegexFTPFileEntryParserImpl object. The expression is compiled with flags = 0.- Parameters:
- regex- The regular expression with which this object is initialized.
- Throws:
- IllegalArgumentException- Thrown if the regular expression is unparseable. Should not be seen in normal conditions. If 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.
 
- 
RegexFTPFileEntryParserImplThe constructor for a RegexFTPFileEntryParserImpl object.- Parameters:
- regex- The regular expression with which this object is initialized.
- flags- the flags to apply, see- Pattern.compile(String, int). Use 0 for none.
- Throws:
- IllegalArgumentException- Thrown if the regular expression is unparseable. Should not be seen in normal conditions. If 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.
- Since:
- 3.4
 
 
- 
- 
Method Details- 
getGroupCntConvenience method- Returns:
- the number of groups() in the internal MatchResult.
 
- 
getGroupsAsStringFor debugging purposes - returns a string shows each match group by number.- Returns:
- a string shows each match group by number.
 
- 
groupConvenience method delegates to the internal MatchResult's group() method.- Parameters:
- matchNum- match group number to be retrieved
- Returns:
- the content of the matchnum'thgroup of the internal match or null if this method is called without a match having been made.
 
- 
matchesConvenience method delegates to the internal MatchResult's matches() method.- Parameters:
- s- the String to be matched
- Returns:
- true if s matches this object's regular expression.
 
- 
setRegexAlter the current regular expression being utilised for entry parsing and create a newPatterninstance.- Parameters:
- regex- The new regular expression
- Returns:
- true
- Throws:
- IllegalArgumentException- if the regex cannot be compiled
- Since:
- 2.0
 
- 
setRegexAlter the current regular expression being utilised for entry parsing and create a newPatterninstance.- Parameters:
- regex- The new regular expression
- flags- the flags to apply, see- Pattern.compile(String, int). Use 0 for none.
- Returns:
- true
- Throws:
- IllegalArgumentException- if the regex cannot be compiled
- Since:
- 3.4
 
 
-