Class VFSFileSystem
- java.lang.Object
-
- org.apache.commons.configuration2.io.FileSystem
-
- org.apache.commons.configuration2.io.DefaultFileSystem
-
- org.apache.commons.configuration2.io.VFSFileSystem
-
public class VFSFileSystem extends DefaultFileSystem
FileSystem that uses Apache Commons VFS.- Since:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description VFSFileSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBasePath(java.lang.String path)Gets the base path of the given path, for example a directory for a file.java.lang.StringgetFileName(java.lang.String path)Gets the file name of the given path.java.io.InputStreamgetInputStream(java.net.URL url)Gets an input stream for a URL.java.io.OutputStreamgetOutputStream(java.net.URL url)Gets an output stream for a URL.java.lang.StringgetPath(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.URLgetURL(java.lang.String basePath, java.lang.String file)Gets a URL for a base path and file name.java.net.URLlocateFromURL(java.lang.String basePath, java.lang.String fileName)Locates a URL for a base path and file name.-
Methods inherited from class org.apache.commons.configuration2.io.DefaultFileSystem
getInputStream, getOutputStream
-
Methods inherited from class org.apache.commons.configuration2.io.FileSystem
getFileOptionsProvider, getLogger, setFileOptionsProvider, setLogger
-
-
-
-
Method Detail
-
getBasePath
public java.lang.String getBasePath(java.lang.String path)
Description copied from class:FileSystemGets the base path of the given path, for example a directory for a file.- Overrides:
getBasePathin classDefaultFileSystem- Parameters:
path- the source path.- Returns:
- the base path.
-
getFileName
public java.lang.String getFileName(java.lang.String path)
Description copied from class:FileSystemGets the file name of the given path.- Overrides:
getFileNamein classDefaultFileSystem- Parameters:
path- the source path.- Returns:
- the file name.
-
getInputStream
public java.io.InputStream getInputStream(java.net.URL url) throws ConfigurationExceptionDescription copied from class:FileSystemGets an input stream for a URL.- Overrides:
getInputStreamin classDefaultFileSystem- Parameters:
url- the source URL.- Returns:
- an input stream.
- Throws:
ConfigurationException- if an problem occurs getting the input stream.
-
getOutputStream
public java.io.OutputStream getOutputStream(java.net.URL url) throws ConfigurationExceptionDescription copied from class:FileSystemGets an output stream for a URL.- Overrides:
getOutputStreamin classDefaultFileSystem- Parameters:
url- the source URL.- Returns:
- an output stream.
- Throws:
ConfigurationException- if an problem occurs getting the output stream.
-
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:FileSystemGets a path string for the given input where some values may be null.The implementation decides on which argument take precedence.
- Overrides:
getPathin classDefaultFileSystem- 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.MalformedURLExceptionDescription copied from class:FileSystemGets a URL for a base path and file name.- Overrides:
getURLin classDefaultFileSystem- 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:FileSystemLocates a URL for a base path and file name.- Overrides:
locateFromURLin classDefaultFileSystem- Parameters:
basePath- The base path.fileName- The file name.- Returns:
- a URL.
-
-