Package org.apache.struts2
Interface FileManager
- All Known Implementing Classes:
DefaultFileManager
,JBossFileManager
public interface FileManager
Basic interface to access file on the File System and to monitor changes
-
Method Summary
Modifier and TypeMethodDescriptionboolean
fileNeedsReloading
(String fileName) Checks if given file changed and must be reloadedboolean
fileNeedsReloading
(URL fileUrl) Checks if file represented by provided URL changed and must be reloadedCollection<? extends URL>
getAllPhysicalUrls
(URL url) boolean
internal()
User's implementation should return false as then it will be taken in first placeLoads opens the named file and returns the InputStreamvoid
monitorFile
(URL fileUrl) Adds file to list of monitored filesConvert URLs to URLs with "file" protocolvoid
setReloadingConfigs
(boolean reloadingConfigs) Enables configs reloading when config file changedboolean
support()
Indicate if given implementation supports current OS File System
-
Method Details
-
setReloadingConfigs
void setReloadingConfigs(boolean reloadingConfigs) Enables configs reloading when config file changed- Parameters:
reloadingConfigs
-StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD
-
fileNeedsReloading
Checks if given file changed and must be reloaded- Parameters:
fileName
- to check- Returns:
- true if file changed
-
fileNeedsReloading
Checks if file represented by provided URL changed and must be reloaded- Parameters:
fileUrl
- url to a file- Returns:
- true if file exists and should be reloaded, if url is null return false
-
loadFile
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
-
monitorFile
Adds file to list of monitored files- Parameters:
fileUrl
-URL
to file to be monitored
-
normalizeToFileProtocol
Convert URLs to URLs with "file" protocol- 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
-
support
boolean support()Indicate if given implementation supports current OS File System- Returns:
- true if supports current OS File System
-
internal
boolean internal()User's implementation should return false as then it will be taken in first place- Returns:
- true if it's a framework provided implementation
-
getAllPhysicalUrls
- Throws:
IOException
-