public class FileVerification extends Object
Verifies properties of files. This can be used by argument types to add extra validation to the file or directory paths that they accept.
To use it, create an instance, enable the desired verifications and call
verify(ArgumentParser, Argument, File)
.
Modifier and Type | Field and Description |
---|---|
boolean |
verifyCanCreate |
boolean |
verifyCanExecute |
boolean |
verifyCanRead |
boolean |
verifyCanWrite |
boolean |
verifyCanWriteParent |
boolean |
verifyExists |
boolean |
verifyIsAbsolute |
boolean |
verifyIsDirectory |
boolean |
verifyIsFile |
boolean |
verifyNotExists |
Constructor and Description |
---|
FileVerification() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canExecute(File file) |
protected boolean |
canRead(File file) |
protected boolean |
canWrite(File file) |
protected boolean |
exists(File file) |
protected boolean |
isDirectory(File file) |
protected boolean |
isFile(File file) |
FileVerification |
or() |
void |
verify(ArgumentParser parser,
Argument arg,
File file) |
public boolean verifyExists
public boolean verifyNotExists
public boolean verifyIsFile
public boolean verifyIsDirectory
public boolean verifyCanRead
public boolean verifyCanWrite
public boolean verifyCanWriteParent
public boolean verifyCanCreate
public boolean verifyCanExecute
public boolean verifyIsAbsolute
public FileVerification or()
public void verify(ArgumentParser parser, Argument arg, File file) throws ArgumentParserException
ArgumentParserException
protected boolean exists(File file)
protected boolean isDirectory(File file)
protected boolean isFile(File file)
protected boolean canRead(File file)
protected boolean canWrite(File file)
protected boolean canExecute(File file)
Copyright © 2012–2017. All rights reserved.