public abstract class AbstractDirectoryInfo extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractDirectoryInfo.Options
Options for an asString method
|
| Modifier and Type | Field and Description |
|---|---|
protected AbstractDirectoryInfo.Options |
asStringOpt
Option for the return value of asString method.
|
protected IsErrorSetFT |
errors
Local list of errors collected during process, cleared for every new validation call.
|
protected File |
file
The underlying file object for the directory.
|
protected URL |
url
The underlying URL object for the directory.
|
| Constructor and Description |
|---|
AbstractDirectoryInfo(String directory)
Creates a new directory info object from a directory name.
|
AbstractDirectoryInfo(String directory,
InfoLocationOptions option)
Creates a new directory info object from a directory name with options.
|
| Modifier and Type | Method and Description |
|---|---|
File |
asFile()
Returns the directory info object name as File object
|
URL |
asURL()
Returns the directory info object name as URL object.
|
String |
getFullDirecoryName()
Returns the full directory name.
|
String |
getSetRootPath()
Returns a path set-as-root to the directory.
|
protected void |
init(String directory,
InfoLocationOptions option)
Initialize the directory info object with any parameters presented by the constructors.
|
boolean |
isValid()
Flag reporting on the validation.
|
protected void |
reset()
Resets all local members to null, except for the error.
|
void |
setAsStringOption(AbstractDirectoryInfo.Options option)
Sets the option for an asString method
|
protected boolean |
testDirectory(File directory)
Test a directory for several conditions (does exist, is not hidden etc).
|
protected boolean |
tryCP(String directory)
Try to locate a directory using any directory given in the class path as set-root.
|
protected boolean |
tryFS(String directory)
Try to locate a directory in the file system.
|
protected abstract ValidationOptions |
valOption()
Returns the validation option which makes this abstract implementation a info object or target or both.
|
protected File file
protected URL url
protected final IsErrorSetFT errors
protected AbstractDirectoryInfo.Options asStringOpt
public AbstractDirectoryInfo(String directory)
directory - name of the directory.
Path information can be relative to any path in the class path.public AbstractDirectoryInfo(String directory, InfoLocationOptions option)
directory - name of the directory.
Path information can be relative to any path in the class path.option - an option on how to locate the directoryprotected void reset()
protected void init(String directory, InfoLocationOptions option)
directory - a directory nameoption - an option on how to locate the directoryprotected final boolean tryFS(String directory)
directory - the directory to locateprotected final boolean tryCP(String directory)
directory - the directory to locateprotected final boolean testDirectory(File directory)
directory - file object to testpublic File asFile()
public URL asURL()
public String getFullDirecoryName()
public String getSetRootPath()
public boolean isValid()
protected abstract ValidationOptions valOption()
public void setAsStringOption(AbstractDirectoryInfo.Options option)
option - new option, only set if not nullCopyright © 2010–2017. All rights reserved.