org.apache.hivemind.util
Class FileResource

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

public class FileResource
extends AbstractResource

An implementation of Resource built around File.

Author:
Howard Lewis Ship

Constructor Summary
FileResource(java.lang.String path)
           
FileResource(java.lang.String path, java.util.Locale locale)
           
 
Method Summary
 Resource getLocalization(java.util.Locale locale)
          Returns a localized version of this resource (or this resource, if no appropriate localization is found).
 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

FileResource

public FileResource(java.lang.String path)

FileResource

public FileResource(java.lang.String path,
                    java.util.Locale locale)
Method Detail

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)
Description copied from interface: Resource
Returns a localized version of this resource (or this resource, if no appropriate localization is found). Should only be invoked on a base resource.

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.

toString

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