Class DefaultFileSystem
- java.lang.Object
-
- org.apache.commons.configuration2.io.FileSystem
-
- org.apache.commons.configuration2.io.DefaultFileSystem
-
- Direct Known Subclasses:
VFSFileSystem
public class DefaultFileSystem extends FileSystem
FileSystem that uses java.io.File or HttpClient.- Since:
- 1.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DefaultFileSystem.HttpOutputStream
Wraps the output stream so errors can be detected in the HTTP response.
-
Constructor Summary
Constructors Constructor Description DefaultFileSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
createPath(java.io.File file)
Create the path to the specified file.java.lang.String
getBasePath(java.lang.String path)
java.lang.String
getFileName(java.lang.String path)
java.io.InputStream
getInputStream(java.net.URL url)
java.io.InputStream
getInputStream(java.net.URL url, URLConnectionOptions urlConnectionOptions)
Not abstract for binary compatibility.java.io.OutputStream
getOutputStream(java.io.File file)
java.io.OutputStream
getOutputStream(java.net.URL url)
java.lang.String
getPath(java.io.File file, java.net.URL url, java.lang.String basePath, java.lang.String fileName)
java.net.URL
getURL(java.lang.String basePath, java.lang.String file)
java.net.URL
locateFromURL(java.lang.String basePath, java.lang.String fileName)
-
Methods inherited from class org.apache.commons.configuration2.io.FileSystem
getFileOptionsProvider, getLogger, setFileOptionsProvider, setLogger
-
-
-
-
Method Detail
-
createPath
private void createPath(java.io.File file) throws ConfigurationException
Create the path to the specified file.- Parameters:
file
- the target file- Throws:
ConfigurationException
- if the path cannot be created
-
getBasePath
public java.lang.String getBasePath(java.lang.String path)
- Specified by:
getBasePath
in classFileSystem
-
getFileName
public java.lang.String getFileName(java.lang.String path)
- Specified by:
getFileName
in classFileSystem
-
getInputStream
public java.io.InputStream getInputStream(java.net.URL url) throws ConfigurationException
- Specified by:
getInputStream
in classFileSystem
- Throws:
ConfigurationException
-
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 classFileSystem
- Parameters:
url
- TODOurlConnectionOptions
- Ignored.- Returns:
- TODO
- Throws:
ConfigurationException
- TODO
-
getOutputStream
public java.io.OutputStream getOutputStream(java.io.File file) throws ConfigurationException
- Specified by:
getOutputStream
in classFileSystem
- Throws:
ConfigurationException
-
getOutputStream
public java.io.OutputStream getOutputStream(java.net.URL url) throws ConfigurationException
- Specified by:
getOutputStream
in classFileSystem
- Throws:
ConfigurationException
-
getPath
public java.lang.String getPath(java.io.File file, java.net.URL url, java.lang.String basePath, java.lang.String fileName)
- Specified by:
getPath
in classFileSystem
-
getURL
public java.net.URL getURL(java.lang.String basePath, java.lang.String file) throws java.net.MalformedURLException
- Specified by:
getURL
in classFileSystem
- Throws:
java.net.MalformedURLException
-
locateFromURL
public java.net.URL locateFromURL(java.lang.String basePath, java.lang.String fileName)
- Specified by:
locateFromURL
in classFileSystem
-
-