io
Class ResourceFinder

java.lang.Object
  extended by io.ResourceFinder

public class ResourceFinder
extends java.lang.Object

A ResourceFinder is used to find a "resource" either in the .jar file (containing the ResourceFinder class) or in the local file system

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Method Summary
static ResourceFinder createInstance()
          Factory method
static ResourceFinder createInstance(java.lang.Object o)
          Factory method
 java.io.InputStream findInputStream(java.lang.String name)
          Find a resource
 java.net.URL findURL(java.lang.String name)
          Find a resource
 java.lang.String[] loadResourceNames(java.lang.String listName)
          Load a list of resource names from a list (e.g., file) Note: This method does not return an array of InputStream objects to conserver resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInstance

public static ResourceFinder createInstance()
Factory method

Returns:
A ResourceFinder that will search "locally"

createInstance

public static ResourceFinder createInstance(java.lang.Object o)
Factory method

Parameters:
o - The Object that defines the location of the search
Returns:
A ResourceFinder that will search "near" o

findInputStream

public java.io.InputStream findInputStream(java.lang.String name)
Find a resource

Returns:
The InputStream of the resource (or null)

findURL

public java.net.URL findURL(java.lang.String name)
Find a resource

Returns:
The URL of the resource (or null)

loadResourceNames

public java.lang.String[] loadResourceNames(java.lang.String listName)
Load a list of resource names from a list (e.g., file) Note: This method does not return an array of InputStream objects to conserver resources.

Parameters:
listName - The name of the list
Returns:
The resource names


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers