Class FileSystem

  • Direct Known Subclasses:
    DefaultFileSystem

    public abstract class FileSystem
    extends java.lang.Object
    Abstract layer to allow various types of file systems.
    Since:
    1.7
    Version:
    $Id: FileSystem.java 1735895 2016-03-20 18:40:47Z oheger $
    Author:
    Commons Configuration team
    • Constructor Detail

      • FileSystem

        public FileSystem()
    • Method Detail

      • getLogger

        public ConfigurationLogger getLogger()
        Returns the logger used by this FileSystem.
        Returns:
        the logger
      • 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
      • setFileOptionsProvider

        public void setFileOptionsProvider​(FileOptionsProvider provider)
        Set the FileOptionsProvider
        Parameters:
        provider - The FileOptionsProvider
      • getPath

        public abstract java.lang.String getPath​(java.io.File file,
                                                 java.net.URL url,
                                                 java.lang.String basePath,
                                                 java.lang.String fileName)
      • getBasePath

        public abstract java.lang.String getBasePath​(java.lang.String path)
      • getFileName

        public abstract java.lang.String getFileName​(java.lang.String path)
      • locateFromURL

        public abstract java.net.URL locateFromURL​(java.lang.String basePath,
                                                   java.lang.String fileName)
      • getURL

        public abstract java.net.URL getURL​(java.lang.String basePath,
                                            java.lang.String fileName)
                                     throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException