public class FileTarget extends AbstractFileInfo implements InfoTarget
AbstractFileInfo.OptionsasStringOpt, errors, file, url| Constructor and Description |
|---|
FileTarget(File file)
Creates a new file target from an existing File object.
|
FileTarget(File file,
boolean doValidate)
Creates a new file target from an existing File object with optional validation.
|
FileTarget(File file,
String setRoot)
Creates a new file target object from an existing File object with a set-as-root directory.
|
FileTarget(String fileName)
Creates a new file target from a file name.
|
FileTarget(String fileName,
InfoLocationOptions option)
Creates a new file target from a file name with options.
|
FileTarget(String directory,
String fileName)
Creates a new file target from a path and a file name.
|
FileTarget(String directory,
String fileName,
InfoLocationOptions option)
Creates a new file target from a path and a file name with options.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asString()
Returns a string representation of the target for messages.
|
static String |
createFile(String fn)
Creates a file for a given absolute file name (absolute path and file name).
|
IsErrorSetFT |
getInitError()
Returns any error that happened during initialization (and relate validation) of the target.
|
Object |
getTarget()
Returns the actual target.
|
protected ValidationOptions |
valOption()
Returns the validation option which makes this abstract implementation a info object or target or both.
|
asFile, asURL, getAbsoluteName, getAbsolutePath, getBaseFileName, getFileExtension, getFullFileName, getRootPath, getSetRootName, getSetRootPath, init, isValid, reset, setAsStringOption, testFile, toString, tryFS, tryResourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisValidpublic FileTarget(File file, boolean doValidate)
file - existing file objectdoValidate - true if internal validation is required, false otherwise (for instance if the file object comes from another loader).
If validation is set to false and the input argument for file is not valid, the behavior of this object and anyone using it is unpredictable.
If validation is set to false a null validation and a validation of the getURI method of the file is still run by the constructor.public FileTarget(File file)
file - existing file objectpublic FileTarget(File file, String setRoot)
file - existing file objectsetRoot - set-as-root directorypublic FileTarget(String fileName)
fileName - name of the file.
The file name must include a path that is accessible.
The file name must include path information if it is not in the root path.
Path information can be relative to any path in the class path.public FileTarget(String fileName, InfoLocationOptions option)
fileName - name of the file.
The file name must include a path that is accessible.
The file name must include path information if it is not in the root path.
Path information can be relative to any path in the class path.option - an option on how to locate the filepublic FileTarget(String directory, String fileName)
directory - a directory in which the file can be found. The directory can be absolute or relative to any directory in the class path.fileName - the file name to locatepublic FileTarget(String directory, String fileName, InfoLocationOptions option)
directory - directory a directory in which the file can be found. The directory can be absolute or relative to any directory in the class path.fileName - the file name to locateoption - an option on how to locate the filepublic Object getTarget()
InfoTargetgetTarget in interface InfoTargetpublic IsErrorSetFT getInitError()
InfoTargetgetInitError in interface InfoTargetprotected ValidationOptions valOption()
AbstractFileInfovalOption in class AbstractFileInfopublic static String createFile(String fn)
fn - absolute file namepublic String asString()
InfoTargetasString in interface InfoTargetCopyright © 2010–2017. All rights reserved.