Package org.apache.commons.vfs2
Class VFS
- java.lang.Object
-
- org.apache.commons.vfs2.VFS
-
public final class VFS extends java.lang.Object
The main entry point for the VFS. Used to createFileSystemManager
instances.
-
-
Field Summary
Fields Modifier and Type Field Description private static FileSystemManager
instance
The FileSystemManagerprivate static java.lang.Boolean
uriStyle
The URI style
-
Constructor Summary
Constructors Modifier Constructor Description private
VFS()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
close()
Closes the defaultFileSystemManager
instance.private static FileSystemManager
createFileSystemManager(java.lang.String managerClassName)
Creates a file system manager instance.static FileSystemManager
getManager()
Returns the defaultFileSystemManager
instance.static boolean
isUriStyle()
static FileSystemManager
reset()
Resets the FileSystemManager to the default.static void
setManager(FileSystemManager manager)
Sets the file system managerstatic void
setUriStyle(boolean uriStyle)
-
-
-
Field Detail
-
instance
private static FileSystemManager instance
The FileSystemManager
-
uriStyle
private static java.lang.Boolean uriStyle
The URI style
-
-
Method Detail
-
close
public static void close()
Closes the defaultFileSystemManager
instance.Warning, if you close the default instance, a new one will be created by
getManager()
.- Since:
- 2.8.0
-
createFileSystemManager
private static FileSystemManager createFileSystemManager(java.lang.String managerClassName) throws FileSystemException
Creates a file system manager instance.- Parameters:
managerClassName
- The specific manager implementation class name.- Returns:
- The FileSystemManager.
- Throws:
FileSystemException
- if an error occurs creating the manager.
-
getManager
public static FileSystemManager getManager() throws FileSystemException
Returns the defaultFileSystemManager
instance.Warning, if you close this instance you may affect all current and future users of this manager singleton.
- Returns:
- The FileSystemManager.
- Throws:
FileSystemException
- if an error occurs creating the manager.
-
isUriStyle
public static boolean isUriStyle()
-
reset
public static FileSystemManager reset() throws FileSystemException
Resets the FileSystemManager to the default.- Returns:
- the new FileSystemManager.
- Throws:
FileSystemException
- if an error occurs creating the manager.- Since:
- 2.5.0
-
setManager
public static void setManager(FileSystemManager manager)
Sets the file system manager- Parameters:
manager
- the file system manager- Since:
- 2.2
-
setUriStyle
public static void setUriStyle(boolean uriStyle)
-
-