Navigation of this series of articles
Apache VFS (1): Basic Introduction
Apache VFS (2): file monitoring and monitoring
Apache VFS (3): file filter and Selector
Apache VFS (4): Events
Apache VFS (5): use it!
Apache VFS (6): several important conceptual Interfaces
Apache VFS (7): File Manager File Parsing Method
It is relatively simple to use Apache VFS. The first object isOrg. apache. commons. vfs. VFS object
. It has threeStatic
Method:
- GetManager
This method is the most important and returns a defaultFilesystemmanager Interface
- SetUriStyle
- IsUriStyle determines whether it is in URI format
FileSystemManager interface and File System Manager interface
The file system manager is responsible for a series of file systems. The file system uses names to locate a file object.ResolveFile ()
Method
The file system manager can identify multiple types of file names:
- Absolute URI
: It must start with the Protocol Schema, for exampleFile:, ftp:
Then follow the file name: file:/c:/temp.txt, ftp://myftp.org/somefile.txt, etc.
- Absolute local file name
: For example,/home/my.txt or C:/DIR/file.txt,Note that the separator can be "/" or "/"
.
- Relative Path
For example, ../DIR/file.txt or home/myfile.txt.
Source: http://alartin.javaeye.com/blog/92332