Class DefaultFileSystem

  • Direct Known Subclasses:
    VFSFileSystem

    public class DefaultFileSystem
    extends FileSystem
    FileSystem that uses java.io.File or HttpClient.
    Since:
    1.7
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultFileSystem()
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getBasePath​(java.lang.String path)
      Gets the base path of the given path, for example a directory for a file.
      java.lang.String getFileName​(java.lang.String path)
      Gets the file name of the given path.
      java.io.InputStream getInputStream​(java.net.URL url)
      Gets an input stream for a URL.
      java.io.InputStream getInputStream​(java.net.URL url, URLConnectionOptions urlConnectionOptions)
      Not abstract for binary compatibility.
      java.io.OutputStream getOutputStream​(java.io.File file)
      Gets an output stream for a File.
      java.io.OutputStream getOutputStream​(java.net.URL url)
      Gets an output stream for a URL.
      java.lang.String getPath​(java.io.File file, java.net.URL url, java.lang.String basePath, java.lang.String fileName)
      Gets a path string for the given input where some values may be null.
      java.net.URL getURL​(java.lang.String basePath, java.lang.String file)
      Gets a URL for a base path and file name.
      java.net.URL locateFromURL​(java.lang.String basePath, java.lang.String fileName)
      Locates a URL for a base path and file name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultFileSystem

        public DefaultFileSystem()
        Constructs a new instance.
    • Method Detail

      • getBasePath

        public java.lang.String getBasePath​(java.lang.String path)
        Description copied from class: FileSystem
        Gets the base path of the given path, for example a directory for a file.
        Specified by:
        getBasePath in class FileSystem
        Parameters:
        path - the source path.
        Returns:
        the base path.
      • getFileName

        public java.lang.String getFileName​(java.lang.String path)
        Description copied from class: FileSystem
        Gets the file name of the given path.
        Specified by:
        getFileName in class FileSystem
        Parameters:
        path - the source path.
        Returns:
        the file name.
      • getInputStream

        public java.io.InputStream getInputStream​(java.net.URL url,
                                                  URLConnectionOptions urlConnectionOptions)
                                           throws ConfigurationException
        Description copied from class: FileSystem
        Not abstract for binary compatibility.
        Overrides:
        getInputStream in class FileSystem
        Parameters:
        url - the URL of the file
        urlConnectionOptions - the URLConnection options
        Returns:
        the input stream for the specified URL
        Throws:
        ConfigurationException - if an error occurs while opening the file
      • getPath

        public java.lang.String getPath​(java.io.File file,
                                        java.net.URL url,
                                        java.lang.String basePath,
                                        java.lang.String fileName)
        Description copied from class: FileSystem
        Gets a path string for the given input where some values may be null.

        The implementation decides on which argument take precedence.

        Specified by:
        getPath in class FileSystem
        Parameters:
        file - A file.
        url - A URL.
        basePath - A base path string.
        fileName - A file name.
        Returns:
        A path string.
      • getURL

        public java.net.URL getURL​(java.lang.String basePath,
                                   java.lang.String file)
                            throws java.net.MalformedURLException
        Description copied from class: FileSystem
        Gets a URL for a base path and file name.
        Specified by:
        getURL in class FileSystem
        Parameters:
        basePath - The base path.
        file - The file name.
        Returns:
        a URL.
        Throws:
        java.net.MalformedURLException - if a problem occurs creating the URL.
      • locateFromURL

        public java.net.URL locateFromURL​(java.lang.String basePath,
                                          java.lang.String fileName)
        Description copied from class: FileSystem
        Locates a URL for a base path and file name.
        Specified by:
        locateFromURL in class FileSystem
        Parameters:
        basePath - The base path.
        fileName - The file name.
        Returns:
        a URL.