org.jdesktop.wonderland.common
Class WlHttpURI

java.lang.Object
  extended by org.jdesktop.wonderland.common.AssetURI
      extended by org.jdesktop.wonderland.common.WlHttpURI
All Implemented Interfaces:
java.io.Serializable

public class WlHttpURI
extends AssetURI

A WlHttpURI is an asset uri to handle URL's through the asset manager.

Author:
Jordan Slott
See Also:
Serialized Form

Constructor Summary
WlHttpURI(java.lang.String uri)
          Constructor which takes the string represents of the URI with the wlhttp protocol.
WlHttpURI(java.net.URL url)
          Constructor which takes the URL with the http protocol
 
Method Summary
 java.lang.String getBaseURL()
          Returns the "base" url, which is the protocol and the host/port name, using a protocol of 'http'.
 java.lang.String getRelativeCachePath()
          Returns a relative path of the asset so that it exists in a unique location within a cache.
 java.lang.String getRelativePath()
          Returns the relative path of the url.
 void setServerHostAndPort(java.lang.String hostNameAndPort)
          Annotates this URI with a : based upon the current primary server.
 java.net.URL toURL()
          Returns a URL from the URI.
 
Methods inherited from class org.jdesktop.wonderland.common.AssetURI
equals, getProtocol, getURI, hashCode, toExternalForm, toString, uriFactory
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WlHttpURI

public WlHttpURI(java.lang.String uri)
          throws java.net.URISyntaxException,
                 java.net.MalformedURLException
Constructor which takes the string represents of the URI with the wlhttp protocol.

Parameters:
uri - The string URI representation
Throws:
java.net.URISyntaxException
java.net.MalformedURLException

WlHttpURI

public WlHttpURI(java.net.URL url)
          throws java.net.URISyntaxException,
                 java.net.MalformedURLException
Constructor which takes the URL with the http protocol

Parameters:
url - The URL
Throws:
java.net.URISyntaxException
java.net.MalformedURLException
Method Detail

getRelativeCachePath

public java.lang.String getRelativeCachePath()
Returns a relative path of the asset so that it exists in a unique location within a cache. The path does not have a leading "/".

Specified by:
getRelativeCachePath in class AssetURI
Returns:
A unique relative path for the URI

setServerHostAndPort

public void setServerHostAndPort(java.lang.String hostNameAndPort)
Description copied from class: AssetURI
Annotates this URI with a : based upon the current primary server. This method is implemented by subclasses who need a reference to the current server in order to resolve the asset. For URIs that do not need this information, this method does nothing.

Specified by:
setServerHostAndPort in class AssetURI
Parameters:
hostNameAndPort - The host name and port to annotate the URI with

toURL

public java.net.URL toURL()
                   throws java.net.MalformedURLException
Returns a URL from the URI.

Specified by:
toURL in class AssetURI
Returns:
A URL
Throws:
java.net.MalformedURLException

getBaseURL

public java.lang.String getBaseURL()
Returns the "base" url, which is the protocol and the host/port name, using a protocol of 'http'.


getRelativePath

public java.lang.String getRelativePath()
Returns the relative path of the url.



Open Wonderland - http://openwonderland.org