The
FileValidator
validates the string argument values are files. If the value is a file, the string value in the {@link java.util.List} of values is replaced with the{@link java.io.File} instance.The following attributes can also be specified using the appropriate settors:
- writable
- readable
- hidden
- existing
- is a file
- is a directory
The following example shows how to limit the valid values for the config attribute to files that are readable, writeable, and that already existing.
... ArgumentBuilder builder = new ArgumentBuilder(); FileValidator validator = FileValidator.getExistingFileInstance(); validator.setReadable(true); validator.setWritable(true); Argument age = builder.withName("config"); .withValidator(validator);
@author Rob Oxspring
@author John Keyes