|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.imaging.util.PathSplitter
public class PathSplitter
Splits a String representation path where elements are separated by defined or default ('/') separator. Leading and trailing separators are ignored. Empty elements are not ("/a//c/" as three elements, "a", "" and "c") This keeps an internal iterator, such that for an input of "/foo/bar/baz/a/b/c/d/e", following sequence of calls:
Constructor Summary | |
---|---|
PathSplitter(String source)
Splits with the '/' character (NOT the system-specific file separator) and trims extensions. |
|
PathSplitter(String source,
boolean trimExtension)
Splits with the '/' character (NOT the system-specific file separator). |
|
PathSplitter(String source,
char separator,
boolean trimExtension)
|
Method Summary | |
---|---|
int |
count()
Returns the number of path elements in the source string. |
String |
next()
Returns the next path element from the internal iterator. |
String |
remaining()
Returns all the elements lefts after the last call to at() or next(), *without* a leading separator. |
String |
skipTo(int index)
Returns the element at the given 0-based index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PathSplitter(String source)
public PathSplitter(String source, boolean trimExtension)
public PathSplitter(String source, char separator, boolean trimExtension)
Method Detail |
---|
public int count()
public String next()
public String skipTo(int index)
ArrayIndexOutOfBoundsException
public String remaining()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |