|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.dna.maven.MavenUrl
public class MavenUrl
Wrapper for a URL that uses a format for referencing JCR nodes and content.
| Field Summary | |
|---|---|
static java.lang.String |
JCR_PROTOCOL
|
static int |
NO_PORT
|
| Constructor Summary | |
|---|---|
MavenUrl()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getHostname()
Get the host name |
java.lang.String |
getHostnameAndPort()
|
java.lang.String |
getPath()
|
int |
getPort()
Get the port. |
java.net.URL |
getUrl(java.net.URLStreamHandler handler,
TextEncoder encoder)
Get a URL that corresponds to the information in this object. |
java.lang.String |
getWorkspaceName()
|
static MavenUrl |
parse(java.lang.String url,
TextEncoder decoder)
Parse the supplied URL and determine if the URL fits the JCR URL format. |
static MavenUrl |
parse(java.net.URL url,
TextEncoder decoder)
Parse the supplied URL and determine if the URL fits the JCR URL format. |
void |
setHostname(java.lang.String hostname)
|
void |
setPath(java.lang.String path)
|
void |
setPort(int port)
|
void |
setWorkspaceName(java.lang.String workspaceName)
Set the name of the workspace. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_PORT
public static final java.lang.String JCR_PROTOCOL
| Constructor Detail |
|---|
public MavenUrl()
| Method Detail |
|---|
public java.lang.String getHostname()
public void setHostname(java.lang.String hostname)
hostname - the new host namepublic int getPort()
NO_PORT if the port has not been specified.
public void setPort(int port)
port - the new port, or NO_PORT if there is no portpublic java.lang.String getHostnameAndPort()
public java.lang.String getWorkspaceName()
public void setWorkspaceName(java.lang.String workspaceName)
workspaceName - the name of the workspacepublic java.lang.String getPath()
public void setPath(java.lang.String path)
path - Sets path to the specified value.
public java.net.URL getUrl(java.net.URLStreamHandler handler,
TextEncoder encoder)
throws java.net.MalformedURLException
handler - the URL stream handler that will be used to handle obtaining an input stream or an output stream on the
resulting URLencoder - an encoder that will be used to escape any characters that are not allowed in URLs; UrlEncoder will
be used if no encoder is specified
java.net.MalformedURLException - if the resulting URL would be malformedpublic java.lang.String toString()
toString in class java.lang.Object
public static MavenUrl parse(java.lang.String url,
TextEncoder decoder)
MavenUrl instance;
otherwise return null. If the URL is malformed or otherwise invalid, this method also returns null.
The URL format is expected to fit the following pattern:
jcr://hostname:port/workspaceName/path/to/node
where
url - the URL to be parseddecoder - the text encoder that should be used to decode the URL; may be null if no decoding should be done
public static MavenUrl parse(java.net.URL url,
TextEncoder decoder)
MavenUrl instance;
otherwise return null. If the URL is malformed or otherwise invalid, this method also returns null.
url - the URL to be parseddecoder - the text encoder that should be used to decode the URL; may be null if no decoding should be done
parse(String,TextEncoder)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||