public class YadisUrl
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.net.URL |
_yadisUrl
A YadisURL is a regular URL, with a couple restrictions.
|
Constructor and Description |
---|
YadisUrl(java.lang.String urlString)
Contructs a YadisURL from a string;
assumes the string to be a URL-type identifier
|
YadisUrl(java.net.URL urlId)
Constructs a YadisURL from a URL object;
insures the schema is HTTP or HTTPS
|
YadisUrl(XriIdentifier xriId)
Constructs a YadisURL from an XRI identifier.
|
Modifier and Type | Method and Description |
---|---|
java.net.URL |
getUrl()
Gets the URL to be used in Yadis transactions.
|
private boolean |
isValid(java.net.URL url)
Validates a URL against the requirements for a YadisUrl.
|
java.lang.String |
toString()
Gets a string representation of the YadisURL.
|
private static java.net.URL |
urlFromString(java.lang.String urlString)
Constructs a URL object from a string;
needed by the YadisURL(String) constructor
|
private java.net.URL _yadisUrl
public YadisUrl(java.lang.String urlString) throws YadisException
urlString
- URL-type identifier in string formatYadisException
- if the provided string cannot be a YadisUrlpublic YadisUrl(java.net.URL urlId) throws YadisException
urlId
- URL identifierYadisException
- tf the URL identifier is not a valid YadisURLpublic YadisUrl(XriIdentifier xriId) throws YadisException
xriId
- The XRI identifierYadisException
private static java.net.URL urlFromString(java.lang.String urlString) throws YadisException
urlString
- URL-type identifier in string formatYadisException
- if the provided string is not a valid URLprivate boolean isValid(java.net.URL url)
The URL must be absolute (the schema must be specified), and the schema must be HTTP or HTTPS.
url
- the URL to be validatedpublic java.net.URL getUrl()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2006-2008 Sxip Identity Corporation