|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.townleyenterprises.common.Path
This class provides methods equivalent to the UNIX commands
dirname
and basename
based on arbitrary
path separators.
Method Summary | |
static java.lang.String |
basename(java.lang.String path,
java.lang.String pd)
This version of the basename command exposes just the path and the delimiter. |
static java.lang.String |
basename(java.lang.String path,
java.lang.String pd,
java.lang.String suffix)
This method is used to strip the path name and optional suffix from a given delimited string representing some kind of path. |
static java.lang.String |
classname(java.lang.String name)
This method is used to remove the package name from a Java class. |
static java.lang.String |
dirname(java.lang.String path)
This method provides the exact functionality of the UNIX dirname command. |
static java.lang.String |
getExtension(java.lang.String s)
This method is used to get the "file extension" from the string. |
static java.lang.String |
pathname(java.lang.String path,
java.lang.String pd)
This method returns the path portion of the delimited string similar to the UNIX dirname command, but for arbitrary delimiters. |
static java.lang.String |
stripExtension(java.lang.String s)
This method is used to strip the trailing "file extension" from the given string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.String basename(java.lang.String path, java.lang.String pd, java.lang.String suffix)
path
- the path stringpd
- the path delimitersuffix
- the suffix to remove
public static java.lang.String basename(java.lang.String path, java.lang.String pd)
path
- the path stringpd
- the path delimiter
public static java.lang.String classname(java.lang.String name)
name
- the Java class name
public static java.lang.String pathname(java.lang.String path, java.lang.String pd)
path
- the path stringpd
- the path delimiter
public static java.lang.String dirname(java.lang.String path)
'/'
character.
path
- the path string
"."
if the path
does not have a directory.public static java.lang.String stripExtension(java.lang.String s)
s
- the string
public static java.lang.String getExtension(java.lang.String s)
s
- the string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |