public class URL extends Object
| Constructor and Description |
|---|
URL(List<String> segments,
Metadata metadata)
Create a URL object for the given url segments (separated by '/' from the original url string), using the given
metadata object to represent the encoding and leading/trailing slash information about this URL.
|
URL(String url)
Create a URL object for the given url String.
|
| Modifier and Type | Method and Description |
|---|---|
static URL |
build(List<String> segments,
Metadata metadata) |
static URL |
build(String url) |
URL |
decode()
Return a decoded form of this URL.
|
URL |
encode()
Return an encoded form of this URL.
|
List<String> |
getDecodedSegments()
Get a list of all decoded segments (separated by '/') in this URL.
|
List<String> |
getEncodedSegments()
Get a list of all encoded segments (separated by '/') in this URL.
|
String |
getEncoding()
Get the character encoding of this URL (default UTF-8)
|
Metadata |
getMetadata()
Get the
Metadata object for this URL |
List<String> |
getSegments()
Return all segments (separated by '/') in this URL
|
boolean |
hasLeadingSlash()
Return true if this URL begins with '/'
|
boolean |
hasTrailingSlash()
Return true if this URL ends with '/'
|
int |
numSegments()
Get the number of segments (separated by '/') in this URL
|
void |
setEncoding(String encoding)
Set the character encoding of this URL (default UTF-8)
|
void |
setMetadata(Metadata metadata)
Set the
Metadata object for this URL |
String |
toString()
Return a String representation of this URL
|
String |
toURL()
Return a String representation of this URL
|
public URL(String url)
url - The raw, un-decoded url Stringpublic List<String> getDecodedSegments()
public List<String> getEncodedSegments()
public URL decode()
public URL encode()
public int numSegments()
public String toString()
public String toURL()
public List<String> getSegments()
public boolean hasLeadingSlash()
public boolean hasTrailingSlash()
public String getEncoding()
public void setEncoding(String encoding)
Copyright © 2014 OCPsoft. All Rights Reserved.