org.apache.hivemind.util
Class URLResource

java.lang.Object
  extended by org.apache.hivemind.util.AbstractResource
      extended by org.apache.hivemind.util.URLResource
All Implemented Interfaces:
Resource

public class URLResource
extends AbstractResource

An implementation of Resource built around a string representation of a URL.

Author:
Howard Lewis Ship

Constructor Summary
URLResource(java.lang.String path)
           
URLResource(java.net.URL url)
           
 
Method Summary
 Resource getLocalization(java.util.Locale locale)
          Always returns this location; no localization check occurs.
 java.net.URL getResourceURL()
          Returns a URL for the resource.
protected  Resource newResource(java.lang.String path)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.hivemind.util.AbstractResource
equals, getLocale, getName, getPath, getRelativeResource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLResource

public URLResource(java.net.URL url)

URLResource

public URLResource(java.lang.String path)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

newResource

protected Resource newResource(java.lang.String path)
Specified by:
newResource in class AbstractResource

getResourceURL

public java.net.URL getResourceURL()
Description copied from interface: Resource
Returns a URL for the resource.

Returns:
the URL for the resource if it exists, or null if it does not

getLocalization

public Resource getLocalization(java.util.Locale locale)
Always returns this location; no localization check occurs.

Parameters:
locale - to localize for, or null for no localization.
Returns:
a localized version of this resource, of null if the resource itself does not exist.