public class DefaultFileManager extends Object implements FileManager
FileManager
Modifier and Type | Field and Description |
---|---|
protected static Map<String,Revision> |
files |
protected boolean |
reloadingConfigs |
Constructor and Description |
---|
DefaultFileManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
fileNeedsReloading(String fileName)
Checks if given file changed and must be reloaded
|
boolean |
fileNeedsReloading(URL fileUrl)
Checks if file represented by provided URL changed and must be reloaded
|
Collection<? extends URL> |
getAllPhysicalUrls(URL url) |
boolean |
internal()
User's implementation should return false as then it will be taken in first place
|
protected boolean |
isJarURL(URL fileUrl)
Check if given URL is matching Jar pattern for different servers
|
InputStream |
loadFile(URL fileUrl)
Loads opens the named file and returns the InputStream
|
void |
monitorFile(URL fileUrl)
Adds file to list of monitored files
|
URL |
normalizeToFileProtocol(URL url)
Convert URLs to URLs with "file" protocol
|
void |
setReloadingConfigs(boolean reloadingConfigs)
Enables configs reloading when config file changed
|
boolean |
support()
Indicate if given implementation supports current OS File System
|
public void setReloadingConfigs(boolean reloadingConfigs)
FileManager
setReloadingConfigs
in interface FileManager
reloadingConfigs
- StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD
public boolean fileNeedsReloading(URL fileUrl)
FileManager
fileNeedsReloading
in interface FileManager
fileUrl
- url to a filepublic boolean fileNeedsReloading(String fileName)
FileManager
fileNeedsReloading
in interface FileManager
fileName
- to checkpublic InputStream loadFile(URL fileUrl)
FileManager
loadFile
in interface FileManager
fileUrl
- - the URL of the file to openpublic void monitorFile(URL fileUrl)
FileManager
monitorFile
in interface FileManager
fileUrl
- URL
to file to be monitoredprotected boolean isJarURL(URL fileUrl)
fileUrl
- jar file URLpublic URL normalizeToFileProtocol(URL url)
FileManager
normalizeToFileProtocol
in interface FileManager
url
- URL to convert to a jar urlpublic boolean support()
FileManager
support
in interface FileManager
public boolean internal()
FileManager
internal
in interface FileManager
public Collection<? extends URL> getAllPhysicalUrls(URL url) throws IOException
getAllPhysicalUrls
in interface FileManager
IOException
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.