Class DefaultFileSystem
java.lang.Object
org.apache.commons.configuration2.io.FileSystem
org.apache.commons.configuration2.io.DefaultFileSystem
- Direct Known Subclasses:
VFSFileSystem
FileSystem that uses java.io.File or HttpClient.
- Since:
- 1.7
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBasePath
(String path) Gets the base path of the given path, for example a directory for a file.getFileName
(String path) Gets the file name of the given path.getInputStream
(URL url) Gets an input stream for a URL.getInputStream
(URL url, URLConnectionOptions urlConnectionOptions) Not abstract for binary compatibility.getOutputStream
(File file) Gets an output stream for a File.getOutputStream
(URL url) Gets an output stream for a URL.Gets a path string for the given input where some values may be null.Gets a URL for a base path and file name.locateFromURL
(String basePath, String fileName) Locates a URL for a base path and file name.Methods inherited from class org.apache.commons.configuration2.io.FileSystem
getFileOptionsProvider, getLogger, setFileOptionsProvider, setLogger
-
Constructor Details
-
DefaultFileSystem
public DefaultFileSystem()
-
-
Method Details
-
getBasePath
Description copied from class:FileSystem
Gets the base path of the given path, for example a directory for a file.- Specified by:
getBasePath
in classFileSystem
- Parameters:
path
- the source path.- Returns:
- the base path.
-
getFileName
Description copied from class:FileSystem
Gets the file name of the given path.- Specified by:
getFileName
in classFileSystem
- Parameters:
path
- the source path.- Returns:
- the file name.
-
getInputStream
Description copied from class:FileSystem
Gets an input stream for a URL.- Specified by:
getInputStream
in classFileSystem
- Parameters:
url
- the source URL.- Returns:
- an input stream.
- Throws:
ConfigurationException
- if an problem occurs getting the input stream.
-
getInputStream
public InputStream getInputStream(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
Description copied from class:FileSystem
Gets an output stream for a File.- Specified by:
getOutputStream
in classFileSystem
- Parameters:
file
- the source File.- Returns:
- an output stream.
- Throws:
ConfigurationException
- if an problem occurs getting the output stream.
-
getOutputStream
Description copied from class:FileSystem
Gets an output stream for a URL.- Specified by:
getOutputStream
in classFileSystem
- Parameters:
url
- the source URL.- Returns:
- an output stream.
- Throws:
ConfigurationException
- if an problem occurs getting the output stream.
-
getPath
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 classFileSystem
- Parameters:
file
- A file.url
- A URL.basePath
- A base path string.fileName
- A file name.- Returns:
- A path string.
-
getURL
Description copied from class:FileSystem
Gets a URL for a base path and file name.- Specified by:
getURL
in classFileSystem
- Parameters:
basePath
- The base path.file
- The file name.- Returns:
- a URL.
- Throws:
MalformedURLException
- if a problem occurs creating the URL.
-
locateFromURL
Description copied from class:FileSystem
Locates a URL for a base path and file name.- Specified by:
locateFromURL
in classFileSystem
- Parameters:
basePath
- The base path.fileName
- The file name.- Returns:
- a URL.
-