Class FileSystem
java.lang.Object
org.apache.commons.configuration.FileSystem
- Direct Known Subclasses:
DefaultFileSystem
Abstract layer to allow various types of file systems.
- Since:
- 1.7
- Version:
- $Id: FileSystem.java 1209996 2011-12-03 20:24:21Z oheger $
- Author:
- Commons Configuration team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringgetBasePath(String path) static FileSystemRetrieve the FileSystem being used.abstract StringgetFileName(String path) abstract InputStreamgetInputStream(String basePath, String fileName) abstract InputStreamgetInputStream(URL url) org.apache.commons.logging.LogReturns the logger used by this FileSystem.abstract OutputStreamgetOutputStream(File file) abstract OutputStreamgetOutputStream(URL url) abstract Stringabstract URLabstract URLlocateFromURL(String basePath, String fileName) static voidReset the FileSystem to the default.static voidSet the FileSystem to use.voidsetFileOptionsProvider(FileOptionsProvider provider) Set the FileOptionsProvidervoidsetLogger(org.apache.commons.logging.Log log) Allows to set the logger to be used by this FileSystem.
-
Constructor Details
-
FileSystem
public FileSystem()
-
-
Method Details
-
getLogger
Returns the logger used by this FileSystem.- Returns:
- the logger
-
setLogger
Allows to set 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.- Parameters:
log- the new logger
-
setDefaultFileSystem
Set the FileSystem to use.- Parameters:
fs- The FileSystem- Throws:
NullPointerException- if the FileSystem parameter is null.
-
resetDefaultFileSystem
Reset the FileSystem to the default. -
getDefaultFileSystem
Retrieve the FileSystem being used.- Returns:
- The FileSystem.
-
setFileOptionsProvider
Set the FileOptionsProvider- Parameters:
provider- The FileOptionsProvider
-
getFileOptionsProvider
-
getInputStream
public abstract InputStream getInputStream(String basePath, String fileName) throws ConfigurationException - Throws:
ConfigurationException
-
getInputStream
- Throws:
ConfigurationException
-
getOutputStream
- Throws:
ConfigurationException
-
getOutputStream
- Throws:
ConfigurationException
-
getPath
-
getBasePath
-
getFileName
-
locateFromURL
-
getURL
- Throws:
MalformedURLException
-