org.jdesktop.wonderland.client.cell.asset
Class AssetUtils

java.lang.Object
  extended by org.jdesktop.wonderland.client.cell.asset.AssetUtils

public class AssetUtils
extends java.lang.Object

Utilities for dealing with assets on the client.

Author:
Jordan Slott

Constructor Summary
AssetUtils()
           
 
Method Summary
static java.net.URL getAssetURL(java.lang.String uri)
          Given a URI as an asset, returns a URL that can be used to download the asset.
static java.net.URL getAssetURL(java.lang.String uri, Cell cell)
          Given a URI as an asset and the cell the asset is being used in, returns a URL that can be used to download the asset.
static java.net.URL getAssetURL(java.lang.String uri, java.lang.String serverNameAndPort)
          Given a URI as an asset and the server name and port (as server:port), returns a URL that can be used to download the asset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetUtils

public AssetUtils()
Method Detail

getAssetURL

public static java.net.URL getAssetURL(java.lang.String uri,
                                       Cell cell)
                                throws java.net.MalformedURLException
Given a URI as an asset and the cell the asset is being used in, returns a URL that can be used to download the asset.

Parameters:
uri - The asset URI
Returns:
A URL for the asset
Throws:
java.net.MalformedURLException

getAssetURL

public static java.net.URL getAssetURL(java.lang.String uri)
                                throws java.net.MalformedURLException
Given a URI as an asset, returns a URL that can be used to download the asset. This method uses the current primary server session as the host name and port for the asset, if applicable.

Parameters:
uri - The asset URI
Returns:
A URL for the asset
Throws:
java.net.MalformedURLException

getAssetURL

public static java.net.URL getAssetURL(java.lang.String uri,
                                       java.lang.String serverNameAndPort)
                                throws java.net.MalformedURLException
Given a URI as an asset and the server name and port (as server:port), returns a URL that can be used to download the asset.

Parameters:
uri - The asset URI
serverNameAndPort - The server:port of the current server
Returns:
A URL for the asset
Throws:
java.net.MalformedURLException


Open Wonderland - http://openwonderland.org