1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs.provider;
18
19 import org.apache.commons.vfs.FileName;
20 import org.apache.commons.vfs.FileObject;
21 import org.apache.commons.vfs.FileSystemConfigBuilder;
22 import org.apache.commons.vfs.FileSystemException;
23 import org.apache.commons.vfs.FileSystemOptions;
24
25 import java.util.Collection;
26
27
28 /***
29 * A file provider. Each file provider is responsible for handling files for
30 * a particular URI scheme.
31 * <p/>
32 * <p>A file provider may also implement {@link VfsComponent}.
33 *
34 * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
35 * @version $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
36 */
37 public interface FileProvider
38 {
39 /***
40 * Locates a file object, by absolute URI.
41 *
42 * @param baseFile The base file to use for resolving the individual parts of
43 * a compound URI.
44 * @param uri The absolute URI of the file to find.
45 * @param fileSystemOptions
46 */
47 FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions)
48 throws FileSystemException;
49
50 /***
51 * Creates a layered file system.
52 *
53 * @param scheme The URI scheme for the layered file system.
54 * @param file The file to build the file system on.
55 * @param fileSystemOptions
56 */
57 FileObject createFileSystem(String scheme, FileObject file, FileSystemOptions fileSystemOptions)
58 throws FileSystemException;
59
60 /***
61 * Gets the configbuilder useable to collect the needed fileSystemOptions.
62 */
63 public FileSystemConfigBuilder getConfigBuilder();
64
65 /***
66 * Get the filesystem capabilities.<br>
67 * These are the same as on the filesystem, but available before the first filesystem was
68 * instanciated.
69 */
70 public Collection getCapabilities();
71
72 public FileName parseUri(FileName root, String uri) throws FileSystemException;
73 }