|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.InputVerifier com.gridsystems.config.tools.TextVerifier com.gridsystems.config.tools.FileVerifier
public class FileVerifier
Verifies that a String is a valid path to a file that exists. Verifies that a String is a valid path to a file that exists. Also checks the file type. Subclasses of this class can refine the filter by reimplementing the checkPattern(File) method.
Field Summary | |
---|---|
static int |
DIRECTORIES_ONLY
Allows only directories. |
static int |
FILE_ALL
Allows paths to existing and non-existing files. |
static int |
FILE_EXIST
Allows paths to existing files. |
static int |
FILE_NOT_EXIST
Allows paths to non-existing files. |
static int |
FILES_AND_DIRECTORIES
Allows both files and directories. |
static int |
FILES_ONLY
Allows only files. |
protected java.lang.String |
id
Error identifier. |
static java.lang.String |
ID_ERROR
Errors detected by this verifier. |
Fields inherited from class com.gridsystems.config.tools.TextVerifier |
---|
support |
Constructor Summary | |
---|---|
FileVerifier(ErrorSupport support,
java.lang.String id)
Creates an instance. |
|
FileVerifier(ErrorSupport support,
java.lang.String id,
int mode,
int constraint)
Creates an instance. |
Method Summary | |
---|---|
boolean |
checkPattern(java.io.File file)
Checks the restrictions in the file name/path. |
void |
cleanErrors()
Removes from the error support manager the list of errors of this verifier. |
boolean |
verify(java.lang.String text)
Validates a text string. |
Methods inherited from class com.gridsystems.config.tools.TextVerifier |
---|
updateError, verify |
Methods inherited from class javax.swing.InputVerifier |
---|
shouldYieldFocus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ID_ERROR
public static final int FILES_AND_DIRECTORIES
public static final int FILES_ONLY
public static final int DIRECTORIES_ONLY
public static final int FILE_ALL
public static final int FILE_EXIST
public static final int FILE_NOT_EXIST
protected java.lang.String id
Constructor Detail |
---|
public FileVerifier(ErrorSupport support, java.lang.String id)
support
- The ErrorSupport instanceid
- The error identifierpublic FileVerifier(ErrorSupport support, java.lang.String id, int mode, int constraint)
support
- The Error support instanceid
- The error identifiermode
- The type of files that will be accepted.
Valid values are FILES_AND_DIRECTORIES
,
DIRECTORIES_ONLY
, and FILES_ONLY
.
If it is neither of them, it defaults to
FILES_AND_DIRECTORIES
constraint
- The existence checks that the files must pass to be
accepted. It can be FILE_ALL
,
FILE_EXIST
and FILE_NOT_EXIST
. If it is
neither of them, it defaults to FILE_ALL
Method Detail |
---|
public boolean verify(java.lang.String text)
verify
in class TextVerifier
text
- The string to validate
public void cleanErrors()
TextVerifier
This method will be used on field deactivation.
cleanErrors
in class TextVerifier
TextVerifier.cleanErrors()
public boolean checkPattern(java.io.File file)
file
- the File object to check.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |