|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.baswell.routes.RequestPath
public class RequestPath
Details of the HTTP request path (minus the application's context path). The request path is broken up into segments where a segment is the text between slashes.
For example there are three path segments ("one", "two", and "three") in the URL:
http://localhost:8080/context_path/one/two/three
This class is immutable. All modification operations (ex. pop()) result in new RequestPath objects returned.
| Method Summary | |
|---|---|
boolean |
equals(java.util.List<java.lang.String> segments)
|
boolean |
equals(java.lang.Object object)
|
boolean |
equals(java.lang.String path)
|
java.lang.String |
get(int index)
|
boolean |
getBoolean(int index)
|
byte |
getByte(int index)
|
char |
getCharacter(int index)
|
double |
getDouble(int index)
|
java.lang.String |
getFileExtension()
If this path contains a file name this method returns the text to the right of the last '.' in the file name. |
java.lang.String |
getFileName()
If the last segment in this path has a '.' then the full (last) segment will be returned. |
float |
getFloat(int index)
|
int |
getInteger(int index)
|
long |
getLong(int index)
|
short |
getShort(int index)
|
RequestPath |
pop()
Same as |
RequestPath |
pop(int numberSegments)
Returns a new RequestPath with the given number of segments removed from the start of the path. |
int |
size()
|
boolean |
startsWith(java.util.List<java.lang.String> segments)
|
boolean |
startsWith(java.lang.String path)
|
RequestPath |
substring(int index)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public int size()
public java.lang.String get(int index)
throws java.lang.IndexOutOfBoundsException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
public char getCharacter(int index)
throws java.lang.IndexOutOfBoundsException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
public boolean getBoolean(int index)
throws java.lang.IndexOutOfBoundsException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
public byte getByte(int index)
throws java.lang.IndexOutOfBoundsException,
java.lang.NumberFormatException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
java.lang.NumberFormatException - If the segment at the given index cannot be parsed into a byte.
public short getShort(int index)
throws java.lang.IndexOutOfBoundsException,
java.lang.NumberFormatException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
java.lang.NumberFormatException - If the segment at the given index cannot be parsed into a short.
public int getInteger(int index)
throws java.lang.IndexOutOfBoundsException,
java.lang.NumberFormatException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
java.lang.NumberFormatException - If the segment at the given index cannot be parsed into a int.
public long getLong(int index)
throws java.lang.IndexOutOfBoundsException,
java.lang.NumberFormatException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
java.lang.NumberFormatException - If the segment at the given index cannot be parsed into a long.
public float getFloat(int index)
throws java.lang.IndexOutOfBoundsException,
java.lang.NumberFormatException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
java.lang.NumberFormatException - If the segment at the given index cannot be parsed into a float.
public double getDouble(int index)
throws java.lang.IndexOutOfBoundsException,
java.lang.NumberFormatException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size()
java.lang.NumberFormatException - If the segment at the given index cannot be parsed into a double.public boolean startsWith(java.lang.String path)
path -
public boolean startsWith(java.util.List<java.lang.String> segments)
segments -
public RequestPath pop(int numberSegments)
throws java.lang.IndexOutOfBoundsException
numberSegments - The number of segments to pop from this path.
java.lang.IndexOutOfBoundsException - If numberSegments < 0 or numberSegments >= size().
public RequestPath pop()
throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException - if size() == 0.pop(int)public java.lang.String getFileName()
public java.lang.String getFileExtension()
public RequestPath substring(int index)
throws java.lang.IndexOutOfBoundsException
index -
java.lang.IndexOutOfBoundsException - If index < 0 or index >= size().public boolean equals(java.lang.String path)
path -
public boolean equals(java.util.List<java.lang.String> segments)
segments -
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||