Java Doc for FileSystemManager.java in  » Library » Apache-commons-vfs-20070724-src » org » apache » commons » vfs » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache commons vfs 20070724 src » org.apache.commons.vfs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.vfs.FileSystemManager

All known Subclasses:   org.apache.commons.vfs.impl.DefaultFileSystemManager,
FileSystemManager
public interface FileSystemManager (Code)
A FileSystemManager manages a set of file systems. This interface is used to locate a FileObject by name from one of those file systems.

To locate a FileObject , use one of the resolveFile() methods.

File Naming

A file system manager can recognise several types of file names:

  • Absolute URI. These must start with a scheme, such as file: or ftp:, followed by a scheme dependent file name. Some examples:

     file:/c:/somefile
     ftp://somewhere.org/somefile
     

  • Absolute local file name. For example, /home/someuser/a-file or c:\dir\somefile.html. Elements in the name can be separated using any of the following characters: /, \, or the native file separator character. For example, the following file names are the same:

     c:\somedir\somefile.xml
     c:/somedir/somefile.xml
     

  • Relative path. For example: ../somefile or somedir/file.txt. The file system manager resolves relative paths against its base file. Elements in the relative path can be separated using /, \, or file system specific separator characters. Relative paths may also contain .. and . elements. See FileObject.resolveFile for more details.


author:
   Adam Murdoch
version:
   $Revision: 484648 $ $Date: 2006-12-08 08:18:36 -0800 (Fri, 08 Dec 2006) $




Method Summary
public  voidaddOperationProvider(String scheme, FileOperationProvider operationProvider)
     Adds the specified FileOperationProvider for the specified scheme.
public  voidaddOperationProvider(String[] schemes, FileOperationProvider operationProvider)
    
public  booleancanCreateFileSystem(FileObject file)
     Determines if a layered file system can be created for a given file.
public  voidcloseFileSystem(FileSystem filesystem)
     Closes the given filesystem.
If you use VFS as singleton it is VERY dangerous to call this method.
public  FileObjectcreateFileSystem(String provider, FileObject file)
     Creates a layered file system.
public  FileObjectcreateFileSystem(FileObject file)
     Creates a layered file system.
public  FileObjectcreateVirtualFileSystem(String rootUri)
     Creates an empty virtual file system.
public  FileObjectcreateVirtualFileSystem(FileObject rootFile)
     Creates a virtual file system.
public  FileObjectgetBaseFile()
     Returns the base file used to resolve relative paths.
public  CacheStrategygetCacheStrategy()
    
public  FileContentInfoFactorygetFileContentInfoFactory()
    
public  ClassgetFileObjectDecorator()
    
public  ConstructorgetFileObjectDecoratorConst()
     The constructor associated to the fileObjectDecorator.
public  FileSystemConfigBuildergetFileSystemConfigBuilder(String scheme)
    
public  FilesCachegetFilesCache()
     Get the cache used to cache fileobjects.
public  FileOperationProvider[]getOperationProviders(String scheme)
    
Parameters:
  scheme - the scheme for wich we want to get the list af registered providers.
public  CollectiongetProviderCapabilities(String scheme)
     Get the capabilities for a given scheme.
public  String[]getSchemes()
     Get the schemes currently available.
public  URLStreamHandlerFactorygetURLStreamHandlerFactory()
     Returns a streamhandler factory to enable URL lookup using this FileSystemManager.
public  FileObjectresolveFile(String name)
     Locates a file by name.
public  FileObjectresolveFile(String name, FileSystemOptions fileSystemOptions)
     Locates a file by name.
public  FileObjectresolveFile(FileObject baseFile, String name)
     Locates a file by name.
public  FileObjectresolveFile(File baseFile, String name)
     Locates a file by name.
public  FileNameresolveName(FileName root, String name)
     Resolves a name, relative to this file name.
public  FileNameresolveName(FileName root, String name, NameScope scope)
     Resolves a name, relative to the "root" file name.
public  FileNameresolveURI(String uri)
    
public  voidsetLogger(Log log)
     Sets the logger to use.
public  FileObjecttoFileObject(File file)
     Converts a local file into a FileObject .
Parameters:
  file - The file to convert.



Method Detail
addOperationProvider
public void addOperationProvider(String scheme, FileOperationProvider operationProvider) throws FileSystemException(Code)
Adds the specified FileOperationProvider for the specified scheme. Several FileOperationProvider's might be registered for the same scheme. For example, for "file" scheme we can register SvnWsOperationProvider and CvsOperationProvider.
Parameters:
  scheme -
Parameters:
  operationProvider -
throws:
  FileSystemException -



addOperationProvider
public void addOperationProvider(String[] schemes, FileOperationProvider operationProvider) throws FileSystemException(Code)

See Also:   FileSystemManager.addOperationProvider(Stringorg.apache.commons.vfs.operations.FileOperationProvider)
Parameters:
  schemes -
Parameters:
  operationProvider -
throws:
  FileSystemException -



canCreateFileSystem
public boolean canCreateFileSystem(FileObject file) throws FileSystemException(Code)
Determines if a layered file system can be created for a given file.
Parameters:
  file - The file to check for.



closeFileSystem
public void closeFileSystem(FileSystem filesystem)(Code)
Closes the given filesystem.
If you use VFS as singleton it is VERY dangerous to call this method.



createFileSystem
public FileObject createFileSystem(String provider, FileObject file) throws FileSystemException(Code)
Creates a layered file system. A layered file system is a file system that is created from the contents of a file, such as a zip or tar file.
Parameters:
  provider - The name of the file system provider to use. This nameis the same as the scheme used in URI to identify the provider.
Parameters:
  file - The file to use to create the file system. The root file of the new file system.
throws:
  FileSystemException - On error creating the file system.



createFileSystem
public FileObject createFileSystem(FileObject file) throws FileSystemException(Code)
Creates a layered file system. A layered file system is a file system that is created from the contents of a file, such as a zip or tar file.
Parameters:
  file - The file to use to create the file system. The root file of the new file system.
throws:
  FileSystemException - On error creating the file system.



createVirtualFileSystem
public FileObject createVirtualFileSystem(String rootUri) throws FileSystemException(Code)
Creates an empty virtual file system. Can be populated by adding junctions to it.
Parameters:
  rootUri - The root URI to use for the new file system. Can be null. The root file of the new file system.



createVirtualFileSystem
public FileObject createVirtualFileSystem(FileObject rootFile) throws FileSystemException(Code)
Creates a virtual file system. The file system will contain a junction at the fs root to the supplied root file.
Parameters:
  rootFile - The root file to backs the file system. The root of the new file system.



getBaseFile
public FileObject getBaseFile() throws FileSystemException(Code)
Returns the base file used to resolve relative paths.



getCacheStrategy
public CacheStrategy getCacheStrategy()(Code)
Get the cache strategy used



getFileContentInfoFactory
public FileContentInfoFactory getFileContentInfoFactory()(Code)
The class to use to determine the content-type (mime-type)



getFileObjectDecorator
public Class getFileObjectDecorator()(Code)
Get the file object decorator used



getFileObjectDecoratorConst
public Constructor getFileObjectDecoratorConst()(Code)
The constructor associated to the fileObjectDecorator. We cache it here for performance reasons.



getFileSystemConfigBuilder
public FileSystemConfigBuilder getFileSystemConfigBuilder(String scheme) throws FileSystemException(Code)
Get the configuration builder for the given scheme
throws:
  FileSystemException - if the given scheme is not konwn



getFilesCache
public FilesCache getFilesCache()(Code)
Get the cache used to cache fileobjects.



getOperationProviders
public FileOperationProvider[] getOperationProviders(String scheme) throws FileSystemException(Code)

Parameters:
  scheme - the scheme for wich we want to get the list af registered providers. the registered FileOperationProviders for the specified scheme.If there were no providers registered for the scheme, it returns null.
throws:
  FileSystemException -



getProviderCapabilities
public Collection getProviderCapabilities(String scheme) throws FileSystemException(Code)
Get the capabilities for a given scheme.
throws:
  FileSystemException - if the given scheme is not konwn



getSchemes
public String[] getSchemes()(Code)
Get the schemes currently available.



getURLStreamHandlerFactory
public URLStreamHandlerFactory getURLStreamHandlerFactory()(Code)
Returns a streamhandler factory to enable URL lookup using this FileSystemManager.



resolveFile
public FileObject resolveFile(String name) throws FileSystemException(Code)
Locates a file by name. Equivalent to calling resolveFile(uri, getBaseName()).
Parameters:
  name - The name of the file. The file. Never returns null.
throws:
  FileSystemException - On error parsing the file name.



resolveFile
public FileObject resolveFile(String name, FileSystemOptions fileSystemOptions) throws FileSystemException(Code)
Locates a file by name. Equivalent to calling resolveFile(uri, getBaseName()).
Parameters:
  name - The name of the file.
Parameters:
  fileSystemOptions - The FileSystemOptions used for FileSystem creation The file. Never returns null.
throws:
  FileSystemException - On error parsing the file name.



resolveFile
public FileObject resolveFile(FileObject baseFile, String name) throws FileSystemException(Code)
Locates a file by name. The name is resolved as described above. That is, the name can be either an absolute URI, an absolute file name, or a relative path to be resolved against baseFile.

Note that the file does not have to exist when this method is called.
Parameters:
  name - The name of the file.
Parameters:
  baseFile - The base file to use to resolve relative paths.May be null. The file. Never returns null.
throws:
  FileSystemException - On error parsing the file name.




resolveFile
public FileObject resolveFile(File baseFile, String name) throws FileSystemException(Code)
Locates a file by name. See FileSystemManager.resolveFile(FileObject,String) for details.
Parameters:
  baseFile - The base file to use to resolve relative paths.May be null.
Parameters:
  name - The name of the file. The file. Never returns null.
throws:
  FileSystemException - On error parsing the file name.



resolveName
public FileName resolveName(FileName root, String name) throws FileSystemException(Code)
Resolves a name, relative to this file name. Equivalent to calling resolveName( path, NameScope.FILE_SYSTEM ).
Parameters:
  root - the base filename
Parameters:
  name - The name to resolve. A FileName object representing the resolved file name.
throws:
  FileSystemException - If the name is invalid.



resolveName
public FileName resolveName(FileName root, String name, NameScope scope) throws FileSystemException(Code)
Resolves a name, relative to the "root" file name. Refer to NameScope for a description of how names are resolved.
Parameters:
  root - the base filename
Parameters:
  name - The name to resolve.
Parameters:
  scope - The NameScope to use when resolving the name. A FileName object representing the resolved file name.
throws:
  FileSystemException - If the name is invalid.



resolveURI
public FileName resolveURI(String uri) throws FileSystemException(Code)
Resolve the uri to a filename
throws:
  FileSystemException - if this is not possible



setLogger
public void setLogger(Log log)(Code)
Sets the logger to use.



toFileObject
public FileObject toFileObject(File file) throws FileSystemException(Code)
Converts a local file into a FileObject .
Parameters:
  file - The file to convert. The FileObject that represents the local file. Neverreturns null.
throws:
  FileSystemException - On error converting the file.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.