org.apache.commons.configuration2.io

## Class FileSystem

- java.lang.Object
- - org.apache.commons.configuration2.io.FileSystem

- Direct Known Subclasses:
    DefaultFileSystem

      public abstract class FileSystem
      extends Object

  Abstract layer to allow various types of file systems.
  Since:
    1.7

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileSystem()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract String` | `getBasePath(String path)`
    `abstract String` | `getFileName(String path)`
    `FileOptionsProvider` | `getFileOptionsProvider()`
    `abstract InputStream` | `getInputStream(URL url)`
    `InputStream` | `getInputStream(URL url, URLConnectionOptions urlConnectionOptions)` Not abstract for binary compatibility.
    `ConfigurationLogger` | `getLogger()` Returns the logger used by this FileSystem.
    `abstract OutputStream` | `getOutputStream(File file)`
    `abstract OutputStream` | `getOutputStream(URL url)`
    `abstract String` | `getPath(File file, URL url, String basePath, String fileName)`
    `abstract URL` | `getURL(String basePath, String fileName)`
    `abstract URL` | `locateFromURL(String basePath, String fileName)`
    `void` | `setFileOptionsProvider(FileOptionsProvider provider)` Set the FileOptionsProvider
    `void` | `setLogger(ConfigurationLogger log)` Allows setting the logger to be used by this FileSystem.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FileSystem

          public FileSystem()

  - ### Method Detail

    - #### getBasePath

          public abstract String getBasePath(String path)

    - #### getFileName

          public abstract String getFileName(String path)

    - #### getFileOptionsProvider

          public FileOptionsProvider getFileOptionsProvider()

    - #### getInputStream

          public abstract InputStream getInputStream(URL url)
                                              throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### getInputStream

          public InputStream getInputStream(URL url,
                                            URLConnectionOptions urlConnectionOptions)
                                     throws ConfigurationException

      Not abstract for binary compatibility.
      Parameters:
        `url` - TODO
        `urlConnectionOptions` - Ignored.
      Returns:
        TODO
      Throws:
        `ConfigurationException` - TODO
      Since:
        2.8.0

    - #### getLogger

          public ConfigurationLogger getLogger()

      Returns the logger used by this FileSystem.
      Returns:
        the logger

    - #### getOutputStream

          public abstract OutputStream getOutputStream(File file)
                                                throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### getOutputStream

          public abstract OutputStream getOutputStream(URL url)
                                                throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### getPath

          public abstract String getPath(File file,
                                         URL url,
                                         String basePath,
                                         String fileName)

    - #### getURL

          public abstract URL getURL(String basePath,
                                     String fileName)
                              throws MalformedURLException

      Throws:
        `MalformedURLException`

    - #### locateFromURL

          public abstract URL locateFromURL(String basePath,
                                            String fileName)

    - #### setFileOptionsProvider

          public void setFileOptionsProvider(FileOptionsProvider provider)

      Set the FileOptionsProvider
      Parameters:
        `provider` - The FileOptionsProvider

    - #### setLogger

          public void setLogger(ConfigurationLogger log)

      Allows setting the logger to be used by this FileSystem. This method makes it possible for clients to exactly control logging behavior. Per default a logger is set that will ignore all log messages. Derived classes that want to enable logging should call this method during their initialization with the logger to be used. Passing in a null argument disables logging.
      Parameters:
        `log` - the new logger

Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.