com.opensymphony.xwork2.util
Class FileManager

java.lang.Object
  extended by com.opensymphony.xwork2.util.FileManager

public class FileManager
extends Object

FileManager

This class was brought in from oscore trunk revision 147.

Author:
Jason Carreira Created May 7, 2003 8:44:26 PM

Nested Class Summary
private static class FileManager.FileRevision
          Represents file resource revision, used for file://* resources
private static class FileManager.JarEntryRevision
          Represents jar resurce revision, used for jar://* resource
private static class FileManager.JBossFileRevision
          Represents file resource revision, used for vfszip://* resources
private static class FileManager.Revision
          Class represents common revsion resource, should be used as default class when no other option exists
 
Field Summary
private static Map<String,FileManager.Revision> files
           
private static String JAR_FILE_EXTENSION_END
           
private static String JAR_FILE_NAME_SEPARATOR
           
private static Logger LOG
           
protected static boolean reloadingConfigs
           
 
Constructor Summary
private FileManager()
           
 
Method Summary
static boolean fileNeedsReloading(String fileName)
           
static boolean fileNeedsReloading(String fileName, Class clazz)
           
static boolean isReloadingConfigs()
           
static InputStream loadFile(String fileName, Class clazz)
          Loads opens the named file and returns the InputStream
static InputStream loadFile(URL fileUrl)
          Loads opens the named file and returns the InputStream
static InputStream loadFile(URL fileUrl, boolean openStream)
          Loads opens the named file and returns the InputStream
static void setReloadingConfigs(boolean reloadingConfigs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static Logger LOG

files

private static Map<String,FileManager.Revision> files

reloadingConfigs

protected static boolean reloadingConfigs

JAR_FILE_NAME_SEPARATOR

private static final String JAR_FILE_NAME_SEPARATOR
See Also:
Constant Field Values

JAR_FILE_EXTENSION_END

private static final String JAR_FILE_EXTENSION_END
See Also:
Constant Field Values
Constructor Detail

FileManager

private FileManager()
Method Detail

setReloadingConfigs

public static void setReloadingConfigs(boolean reloadingConfigs)

isReloadingConfigs

public static boolean isReloadingConfigs()

fileNeedsReloading

public static boolean fileNeedsReloading(String fileName,
                                         Class clazz)

fileNeedsReloading

public static boolean fileNeedsReloading(String fileName)

loadFile

public static InputStream loadFile(String fileName,
                                   Class clazz)
Loads opens the named file and returns the InputStream

Parameters:
fileName - - the name of the file to open
Returns:
an InputStream of the file contents or null
Throws:
IllegalArgumentException - if there is no file with the given file name

loadFile

public static InputStream loadFile(URL fileUrl)
Loads opens the named file and returns the InputStream

Parameters:
fileUrl - - the URL of the file to open
Returns:
an InputStream of the file contents or null
Throws:
IllegalArgumentException - if there is no file with the given file name

loadFile

public static InputStream loadFile(URL fileUrl,
                                   boolean openStream)
Loads opens the named file and returns the InputStream

Parameters:
fileUrl - - the URL of the file to open
openStream - - if true, open an InputStream to the file and return it
Returns:
an InputStream of the file contents or null
Throws:
IllegalArgumentException - if there is no file with the given file name


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.