com.ice.util
Class ResourceUtilities

java.lang.Object
  |
  +--com.ice.util.ResourceUtilities

public class ResourceUtilities
extends java.lang.Object


Constructor Summary
ResourceUtilities()
           
 
Method Summary
static void copyResourceToFile(java.lang.String resourceURL, java.io.File destFile)
          Copies a named resource to a File.
static java.io.InputStream openNamedResource(java.lang.String resourceURL)
          Opens a resource and return an InputStream that will read the contents of the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceUtilities

public ResourceUtilities()
Method Detail

copyResourceToFile

public static void copyResourceToFile(java.lang.String resourceURL,
                                      java.io.File destFile)
                               throws java.io.IOException
Copies a named resource to a File.

Parameters:
resourceURL - The name of the resource to copy.
destFile - The File to copy the resource's contents into.
java.io.IOException

openNamedResource

public static java.io.InputStream openNamedResource(java.lang.String resourceURL)
                                             throws java.io.IOException
Opens a resource and return an InputStream that will read the contents of the resource. A resource URL is used to name the resource. The URL can be any valid URL to which you can establish a connect, including web pages, ftp site files, and files in the CLASSPATH including JAR files.

To open a file on the CLASSPATH, use a full class name, with the slash syntax, such "/com/ice/util/ResourceUtilities.class". Note the leading slash.

Returns:
The InputStream that will read the resource's contents.
java.io.IOException


Copyright © 1997-2003, Timothy G. Endres, All Rights Reserved.