|
Oracle® WebCenter Content Site Studio for External Applications Java API Reference 11g Release 1 (11.1.1) E17273-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.stellent.wcm.common.utils.PathHelper
public class PathHelper
Field Summary | |
---|---|
static java.lang.String |
BACKWARD_SLASH_STRING |
static char |
CHR_BACK_SLASH Character for "\" |
static char |
CHR_DOT Character for "." |
static char |
FORWARD_SLASH |
static java.lang.String |
FORWARD_SLASH_STRING |
static java.lang.String |
QUESTION_MARK_STRING |
Constructor Summary | |
---|---|
PathHelper() |
Method Summary | |
---|---|
static java.lang.String |
appendPath(java.lang.String... paths) |
static java.lang.String |
concat(java.lang.String s1, java.lang.String s2) Fast 2 string concatenation using StringBuffer . |
static java.lang.String |
ensureForwardSlashes(java.lang.String path) Changes backward slashes to forward slashes. |
static java.lang.String |
ensureStartingSlash(java.lang.String path) Ensure the path starts with a slash For example: aaa --> /aaa aaa/ --> /aaa/ aaa/bbb/ccc --> /aaa/bbb/ccc /aaa/bbb/ccc --> /aaa/bbb/ccc / --> / null --> null |
static java.lang.String |
ensureTrailingSlash(java.lang.String path) Ensure the path ends with a slash For example: aaa --> aaa/ /aaa --> /aaa/ aaa/bbb/ccc --> /aaa/bbb/ccc/ /aaa/bbb/ccc --> /aaa/bbb/ccc/ / --> / null --> null |
static java.lang.String |
getFirstPathSegment(java.lang.String path) Parse first segment out of a path For example: aaa/bbb/ccc --> aaa /aaa/bbb/ccc --> aaa / --> null null --> null |
static java.lang.String |
getFirstPathSegment(java.lang.String path, char separator) |
static java.lang.String |
getLastPathSegment(java.lang.String path) Parse last segment out of a path For example: aaa/bbb/ccc --> ccc aaa/bbb/ccc/ --> ccc / --> null null --> null |
static java.lang.String |
getPathSegment(java.lang.String path, int segment, boolean fromStart) Returns the specified path segment. |
static java.lang.String |
justExtension(java.lang.String fullFilePath) Returns just the extension from the specified full file path |
static java.lang.String |
justFileName(java.lang.String fullFilePath) Returns just file name from the specified full file path |
static java.lang.String |
justFileName(java.lang.String fullFilePath, boolean includeExtension) Returns just the file name with or without the extension |
static java.lang.String |
removeStartingQuestionMark(java.lang.String path) Remove the beginning question mark from the given path. |
static java.lang.String |
removeStartingSlash(java.lang.String path) Remove the beginning slash from the given path. |
static java.lang.String |
removeTrailingSlash(java.lang.String path) Remove the ending slash from the given path. |
static java.lang.String |
stripFirstSegment(java.lang.String path) Strip first segment out of a path For example: aaa --> null aaa/ --> null aaa/bbb/ccc --> bbb/ccc aaa/bbb/ccc/ --> /bbb/ccc/ / --> null null --> null |
static java.lang.String |
stripFirstSegment(java.lang.String path, char separator) |
static java.lang.String |
stripLastSegment(java.lang.String path) Strip last segment out of a path For example: aaa --> null aaa/ --> null aaa/bbb/ccc --> aaa/bbb/ /aaa/bbb/ccc --> /aaa/bbb/ / --> null null --> null |
static java.lang.String |
stripLastSegment(java.lang.String path, char separator) |
static java.lang.String |
stripPath(java.lang.String path) Ensure the path does not start or end with slash For example: aaa --> aaa /aaa --> aaa aaa/bbb/ccc --> aaa/bbb/ccc /aaa/bbb/ccc --> aaa/bbb/ccc / --> null null --> null |
static java.lang.String |
stripPath(java.lang.String path, char separator) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char CHR_DOT
public static final char CHR_BACK_SLASH
public static final java.lang.String FORWARD_SLASH_STRING
public static final java.lang.String BACKWARD_SLASH_STRING
public static final java.lang.String QUESTION_MARK_STRING
public static final char FORWARD_SLASH
Constructor Detail |
---|
public PathHelper()
Method Detail |
---|
public static java.lang.String getFirstPathSegment(java.lang.String path)
null
null
--> null
public static java.lang.String getFirstPathSegment(java.lang.String path, char separator)
path
-separator
- is the sepataorgetFirstPathSegment(java.lang.String)
public static java.lang.String getLastPathSegment(java.lang.String path)
null
null
--> null
public static java.lang.String getPathSegment(java.lang.String path, int segment, boolean fromStart)
null
null
--> null
public static java.lang.String stripFirstSegment(java.lang.String path)
null
null
null
null
--> null
public static java.lang.String stripFirstSegment(java.lang.String path, char separator)
stripFirstSegment(java.lang.String)
public static java.lang.String stripLastSegment(java.lang.String path)
null
null
null
null
--> null
public static java.lang.String stripLastSegment(java.lang.String path, char separator)
path
-separator
- the sepatator of the pathstripLastSegment(java.lang.String)
public static java.lang.String ensureStartingSlash(java.lang.String path)
null
--> null
public static java.lang.String ensureTrailingSlash(java.lang.String path)
null
--> null
public static java.lang.String stripPath(java.lang.String path)
null
null
--> null
public static java.lang.String stripPath(java.lang.String path, char separator)
path
-separator
- is the separatorstripPath(java.lang.String)
public static java.lang.String removeStartingSlash(java.lang.String path)
path
- the path to examinepublic static java.lang.String removeStartingQuestionMark(java.lang.String path)
path
- the path to examinepublic static java.lang.String removeTrailingSlash(java.lang.String path)
path
- the path to examinepublic static java.lang.String ensureForwardSlashes(java.lang.String path)
path
- string to modifypublic static java.lang.String justFileName(java.lang.String fullFilePath)
public static java.lang.String justFileName(java.lang.String fullFilePath, boolean includeExtension)
fullFilePath
- the full file pathincludeExtension
- true to include the extensionpublic static java.lang.String justExtension(java.lang.String fullFilePath)
public static java.lang.String appendPath(java.lang.String... paths)
public static java.lang.String concat(java.lang.String s1, java.lang.String s2)
StringBuffer
.s1
- source string #1s2
- source string #2
|
Oracle® WebCenter Content Site Studio for External Applications Java API Reference 11g Release 1 (11.1.1) E17273-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |