Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.xwork2
Interface FileManager

All Known Implementing Classes:
  DefaultFileManager

    public interface FileManager

Basic interface to access file on the File System and to monitor changes

Method Summary
`boolean` | `fileNeedsReloading(String fileName)` Checks if given file changed and must be reloaded if `setReloadingConfigs(boolean)` is true
`boolean` | `fileNeedsReloading(URL fileUrl)` Checks if file represented by provided URL should 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 if `setReloadingConfigs(boolean)` is true
`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` - `XWorkConstants.RELOAD_XML_CONFIGURATION`

### fileNeedsReloading

    boolean fileNeedsReloading(String fileName)

  Checks if given file changed and must be reloaded if `setReloadingConfigs(boolean)` is true

  Parameters:
    `fileName` - to check
  Returns:
    true if file changed

### fileNeedsReloading

    boolean fileNeedsReloading(URL fileUrl)

  Checks if file represented by provided URL should 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 if `setReloadingConfigs(boolean)` is true

  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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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