KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > vfs > provider > FileProvider


1 /*
2  * Copyright 2002-2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.commons.vfs.provider;
17
18 import org.apache.commons.vfs.FileName;
19 import org.apache.commons.vfs.FileObject;
20 import org.apache.commons.vfs.FileSystemConfigBuilder;
21 import org.apache.commons.vfs.FileSystemException;
22 import org.apache.commons.vfs.FileSystemOptions;
23
24 import java.util.Collection JavaDoc;
25
26
27 /**
28  * A file provider. Each file provider is responsible for handling files for
29  * a particular URI scheme.
30  * <p/>
31  * <p>A file provider may also implement {@link VfsComponent}.
32  *
33  * @author <a HREF="mailto:adammurdoch@apache.org">Adam Murdoch</a>
34  */

35 public interface FileProvider
36 {
37     /**
38      * Locates a file object, by absolute URI.
39      *
40      * @param baseFile The base file to use for resolving the individual parts of
41      * a compound URI.
42      * @param uri The absolute URI of the file to find.
43      * @param fileSystemOptions
44      */

45     FileObject findFile(final FileObject baseFile, final String JavaDoc uri, final FileSystemOptions fileSystemOptions)
46         throws FileSystemException;
47
48     /**
49      * Creates a layered file system.
50      *
51      * @param scheme The URI scheme for the layered file system.
52      * @param file The file to build the file system on.
53      * @param fileSystemOptions
54      */

55     FileObject createFileSystem(String JavaDoc scheme, FileObject file, FileSystemOptions fileSystemOptions)
56         throws FileSystemException;
57
58     /**
59      * Gets the configbuilder useable to collect the needed fileSystemOptions.
60      */

61     public FileSystemConfigBuilder getConfigBuilder();
62
63     /**
64      * Get the filesystem capabilities.<br>
65      * These are the same as on the filesystem, but available before the first filesystem was
66      * instanciated.
67      */

68     public Collection JavaDoc getCapabilities();
69
70     public FileName parseUri(FileName root, String JavaDoc uri) throws FileSystemException;
71 }
72
Popular Tags