com.opensymphony.xwork2.util.fs
Class DefaultFileManager

java.lang.Object
  extended by com.opensymphony.xwork2.util.fs.DefaultFileManager
All Implemented Interfaces:
FileManager

public class DefaultFileManager
extends Object
implements FileManager

Default implementation of FileManager


Field Summary
protected  boolean reloadingConfigs
           
 
Constructor Summary
DefaultFileManager()
           
 
Method Summary
 boolean fileNeedsReloading(String fileName)
          Checks if given file changed and must be reloaded if FileManager.isReloadingConfigs() is true
 boolean fileNeedsReloading(URL fileUrl)
          Checks if file represented by provided URL should be reloaded
 boolean isReloadingConfigs()
           
 InputStream loadFile(URL fileUrl)
          Loads opens the named file and returns the InputStream
 void monitorFile(URL fileUrl)
          Adds file to list of monitored files if FileManager.isReloadingConfigs() is true
 void setReloadingConfigs(boolean reloadingConfigs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reloadingConfigs

protected boolean reloadingConfigs
Constructor Detail

DefaultFileManager

public DefaultFileManager()
Method Detail

setReloadingConfigs

public void setReloadingConfigs(boolean reloadingConfigs)
Specified by:
setReloadingConfigs in interface FileManager

isReloadingConfigs

public boolean isReloadingConfigs()
Specified by:
isReloadingConfigs in interface FileManager

fileNeedsReloading

public boolean fileNeedsReloading(URL fileUrl)
Description copied from interface: FileManager
Checks if file represented by provided URL should be reloaded

Specified by:
fileNeedsReloading in interface FileManager
Parameters:
fileUrl - url to a file
Returns:
true if file exists and should be reloaded, if url is null return false

fileNeedsReloading

public boolean fileNeedsReloading(String fileName)
Description copied from interface: FileManager
Checks if given file changed and must be reloaded if FileManager.isReloadingConfigs() is true

Specified by:
fileNeedsReloading in interface FileManager
Parameters:
fileName - to check
Returns:
true if file changed

loadFile

public InputStream loadFile(URL fileUrl)
Description copied from interface: FileManager
Loads opens the named file and returns the InputStream

Specified by:
loadFile in interface FileManager
Parameters:
fileUrl - - the URL of the file to open
Returns:
an InputStream of the file contents or null

monitorFile

public void monitorFile(URL fileUrl)
Description copied from interface: FileManager
Adds file to list of monitored files if FileManager.isReloadingConfigs() is true

Specified by:
monitorFile in interface FileManager
Parameters:
fileUrl - URL to file to be monitored


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