|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.File de.fhg.igd.semoa.starter.FileParameter
This is the super class of file system based Parameter
objects.
It provides the feature to shorten the String
representation
using common abbreviations for the current user directory and
the user home directory.
Field Summary | |
protected String |
abbr_
The abbreviated/short form |
static String |
SHORT_USER_DIR
The abbreviation of the current user directory |
static String |
SHORT_USER_HOME
The abbreviation of the user home directory |
Fields inherited from class java.io.File |
pathSeparator, pathSeparatorChar, separator, separatorChar |
Constructor Summary | |
FileParameter(String file)
Create a FileParameter using file path processing. |
|
FileParameter(String file,
boolean process)
Create a FileParameter . |
Method Summary | |
protected void |
init()
If isValid() returned successfully, an abbreviated and a full
size representation of this FileParameter will be created. |
boolean |
isFlawed()
Indicate whether or not this Parameter is partly invalid
but still useable, e.g. |
protected abstract boolean |
isValid()
Check if this file is a valid FileParameter instance. |
static String |
normalize(String file)
Removes useless ".." and "." elements from an absolute file path without resolving symbolic links. |
static String |
toFull(String file)
Undo transformations done by toShort(java.lang.String) . |
String |
toFullString()
Get the full String representation instead of
the abbreviation . |
static String |
toShort(String file)
Returns a short file by replacing the users home directory (if present) with a tilde char and the current working directory with a dot char. |
String |
toShortString()
Get the abbreviated String representation instead of
the full version . |
String |
toString()
|
Methods inherited from class java.io.File |
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toURI, toURL |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String SHORT_USER_HOME
public static final String SHORT_USER_DIR
protected String abbr_
Constructor Detail |
public FileParameter(String file)
FileParameter
using file path processing.
file
- The original file pathpublic FileParameter(String file, boolean process)
FileParameter
.
file
- The original fileprocess
- if true
file path processing will
take placeMethod Detail |
protected abstract boolean isValid()
FileParameter
instance.
true
if this is a valid FileParameter
instanceprotected void init() throws IllegalArgumentException
isValid()
returned successfully, an abbreviated and a full
size representation of this FileParameter
will be created.
IllegalArgumentException
- if the original file cannot be used to create a valid
instance of this FileParameter
subclasspublic boolean isFlawed()
Parameter
Parameter
is partly invalid
but still useable, e.g. by processing contained invalid elements anyway.
isFlawed
in interface Parameter
Parameter
contains
invalid elementspublic String toShortString()
Parameter
String
representation instead of
the full version
.
toShortString
in interface Parameter
String
representationpublic String toFullString()
Parameter
String
representation instead of
the abbreviation
.
toFullString
in interface Parameter
String
representationpublic static String normalize(String file)
file
- The file to normalize
public static String toFull(String file)
toShort(java.lang.String)
.
file
- The short file name
public static String toShort(String file)
toFull(java.lang.String)
.
file
- The full file name
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |