public class FileNamePattern
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
SimpleFileNamePattern
for available implementations and their syntax.SimpleFileNamePatternFAR
,
SimpleFileNamePatternShell
,
Serialized FormConstructor and Description |
---|
FileNamePattern(java.lang.String simplePattern)
By default a pattern is a simple pattern.
|
FileNamePattern(java.lang.String pattern,
boolean isRegex)
Allows to create a regex pattern or a simple pattern.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a copy of this object.
|
boolean |
equals(java.lang.Object o)
Returns true if pattern and hashcode flag are the same.
|
boolean |
findsAny()
Returns true if this FileNamePattern matches any name, that is, if it is the
".*" regular expression or if it is the "*" simple pattern.
|
java.lang.String |
getPattern()
Returns the pattern.
|
int |
hashCode() |
boolean |
isIgnoreCase()
Returns true if letter case should be ignored
(this is the default).
|
boolean |
isRegex()
Returns true if this pattern represents a regular expression,
false if it is a simple pattern.
|
boolean |
isValid()
Validates the syntax of this file name pattern against the currenty cofigured
SimpleFileNamePattern . |
void |
setIgnoreCase(boolean ignoreCase)
Specify if letter case should be ignored.
|
void |
setPattern(java.lang.String pattern)
Sets the pattern
|
void |
setRegex(boolean isRegex)
Set to true if this pattern represents a regular expression,
false if it is a simple pattern.
|
java.util.regex.Pattern |
toRegexPattern()
Returns the file name pattern as a
java.util.regex.Pattern regular expression. |
java.lang.String |
toString()
Returns the pattern.
|
public FileNamePattern(java.lang.String simplePattern)
simplePattern
- pattern for this class.public FileNamePattern(java.lang.String pattern, boolean isRegex)
pattern
- regex or simpleisRegex
- true if the pattern should be treated as regular expressionpublic boolean isRegex()
public void setRegex(boolean isRegex)
isRegex
- true if pattern is regular expressionpublic java.lang.String getPattern()
public void setPattern(java.lang.String pattern)
pattern
- public boolean isIgnoreCase()
public void setIgnoreCase(boolean ignoreCase)
ignoreCase
- true if letter case should be ignoredpublic java.util.regex.Pattern toRegexPattern() throws PatternException
java.util.regex.Pattern
regular expression.PatternException
- if the pattern string is invalidpublic boolean isValid()
SimpleFileNamePattern
.public boolean findsAny()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.Object clone()
clone
in class java.lang.Object
Object.clone()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object