com.opensymphony.xwork2

## 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

    All Methods Instance Methods Abstract Methods
    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
    `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

- - ### Method Detail

    - #### setReloadingConfigs

          void setReloadingConfigs(boolean reloadingConfigs)

      Enables configs reloading when config file changed
      Parameters:
        `reloadingConfigs` - `StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD`

    - #### fileNeedsReloading

          boolean fileNeedsReloading(String fileName)

      Checks if given file changed and must be reloaded
      Parameters:
        `fileName` - to check
      Returns:
        true if file changed

    - #### fileNeedsReloading

          boolean fileNeedsReloading(URL fileUrl)

      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

          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

    - #### monitorFile

          void monitorFile(URL fileUrl)

      Adds file to list of monitored files
      Parameters:
        `fileUrl` - `URL` to file to be monitored

    - #### normalizeToFileProtocol

          URL normalizeToFileProtocol(URL url)

      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

          Collection<? extends URL> getAllPhysicalUrls(URL url)
                                                throws IOException

      Throws:
        `IOException`

Copyright © 2000–2025 Apache Software Foundation. All rights reserved.