Login | Register
My pages Projects Community openCollabNet

The Tigris site will receive a major upgrade the evening of Monday, December 1, beginning at 8:30 pm PST. Downtime is projected to be about ten hours. Further details in the announcement


jmt.codebase.io
Class ResourceFactory

java.lang.Object
  |
  +--jmt.codebase.io.ResourceFactory

public final class ResourceFactory
extends java.lang.Object

Static factory providing methods to create resource from diffrent source.

Author:
Martin Kersten

Constructor Summary
ResourceFactory()
           
 
Method Summary
static Resources createResources(java.io.File file)
          Returns a Resources instance representing the file.
static Resources createResources(java.io.File[] files)
          Returns the Resources instance representing the files of the array.
static Resources createResources(java.lang.String file)
          Returns a Resources instance representing the named file.
static Resources createResources(java.lang.String[] files)
          Returns the Resources instance represting the files named by the array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFactory

public ResourceFactory()
Method Detail

createResources

public static Resources createResources(java.io.File[] files)
                                 throws java.io.IOException
Returns the Resources instance representing the files of the array.

Parameters:
files - The files to be treated as resources
Returns:
The Resources instance representing the files of the array
Throws:
java.io.IOException - If an i/o-error occured.

createResources

public static Resources createResources(java.lang.String[] files)
                                 throws java.io.IOException
Returns the Resources instance represting the files named by the array.

Parameters:
files - The names of the files
Returns:
The Resources instance represting the files
Throws:
java.io.IOException - If a io error occured.

createResources

public static Resources createResources(java.io.File file)
                                 throws java.io.IOException
Returns a Resources instance representing the file.

The file can be of type

  1. .lst - list of filename to handle
  2. .jar - jar archive to handle its .class and .java entries
  3. .zip - just the same like jar files.
  4. .class - single file resource
  5. .java - single file resource
  6. directory - read all files of the above types and its subdirectories.

Parameters:
file - The file to open
Returns:
The Resources instance representing the file
Throws:
java.io.IOException - If an i/o-error occured.

createResources

public static Resources createResources(java.lang.String file)
                                 throws java.io.IOException
Returns a Resources instance representing the named file.

The file can be of type

  1. .lst - list of filename to handle
  2. .jar - jar archive to handle its .class and .java entries
  3. .zip - just the same like jar files.
  4. .class - single file resource
  5. .java - single file resource
  6. directory - read all files of the above types and its subdirectories.

Parameters:
file - The name of the file to open
Returns:
The Resources instance representing the named file
Throws:
java.io.IOException - If an i/o-error occured.