Package org.apache.struts2.util.fs
Class DefaultFileManager
java.lang.Object
org.apache.struts2.util.fs.DefaultFileManager
- All Implemented Interfaces:
- FileManager
- Direct Known Subclasses:
- JBossFileManager
Default implementation of 
FileManager- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected boolean
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanfileNeedsReloading(String fileName) Checks if given file changed and must be reloadedbooleanfileNeedsReloading(URL fileUrl) Checks if file represented by provided URL changed and must be reloadedCollection<? extends URL>getAllPhysicalUrls(URL url) booleaninternal()User's implementation should return false as then it will be taken in first placeprotected booleanCheck if given URL is matching Jar pattern for different serversLoads opens the named file and returns the InputStreamvoidmonitorFile(URL fileUrl) Adds file to list of monitored filesConvert URLs to URLs with "file" protocolvoidsetReloadingConfigs(boolean reloadingConfigs) Enables configs reloading when config file changedbooleansupport()Indicate if given implementation supports current OS File System
- 
Field Details- 
files
- 
reloadingConfigsprotected boolean reloadingConfigs
 
- 
- 
Constructor Details- 
DefaultFileManagerpublic DefaultFileManager()
 
- 
- 
Method Details- 
setReloadingConfigspublic void setReloadingConfigs(boolean reloadingConfigs) Description copied from interface:FileManagerEnables configs reloading when config file changed- Specified by:
- setReloadingConfigsin interface- FileManager
- Parameters:
- reloadingConfigs-- StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD
 
- 
fileNeedsReloadingDescription copied from interface:FileManagerChecks if file represented by provided URL changed and must be reloaded- Specified by:
- fileNeedsReloadingin interface- FileManager
- Parameters:
- fileUrl- url to a file
- Returns:
- true if file exists and should be reloaded, if url is null return false
 
- 
fileNeedsReloadingDescription copied from interface:FileManagerChecks if given file changed and must be reloaded- Specified by:
- fileNeedsReloadingin interface- FileManager
- Parameters:
- fileName- to check
- Returns:
- true if file changed
 
- 
loadFileDescription copied from interface:FileManagerLoads opens the named file and returns the InputStream- Specified by:
- loadFilein interface- FileManager
- Parameters:
- fileUrl- - the URL of the file to open
- Returns:
- an InputStream of the file contents or null
 
- 
monitorFileDescription copied from interface:FileManagerAdds file to list of monitored files- Specified by:
- monitorFilein interface- FileManager
- Parameters:
- fileUrl-- URLto file to be monitored
 
- 
isJarURLCheck if given URL is matching Jar pattern for different servers- Parameters:
- fileUrl- jar file URL
- Returns:
- if given URL is matching Jar pattern for different servers
 
- 
normalizeToFileProtocolDescription copied from interface:FileManagerConvert URLs to URLs with "file" protocol- Specified by:
- normalizeToFileProtocolin interface- FileManager
- Parameters:
- url- URL to convert to a jar url
- Returns:
- a URL to a file, or null if the URL external form cannot be parsed
 
- 
supportpublic boolean support()Description copied from interface:FileManagerIndicate if given implementation supports current OS File System- Specified by:
- supportin interface- FileManager
- Returns:
- true if supports current OS File System
 
- 
internalpublic boolean internal()Description copied from interface:FileManagerUser's implementation should return false as then it will be taken in first place- Specified by:
- internalin interface- FileManager
- Returns:
- true if it's a framework provided implementation
 
- 
getAllPhysicalUrls- Specified by:
- getAllPhysicalUrlsin interface- FileManager
- Throws:
- IOException
 
 
-