01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
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: * 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: * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
35: */
36: public interface FileProvider {
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 uri,
46: final FileSystemOptions fileSystemOptions)
47: throws FileSystemException;
48:
49: /**
50: * Creates a layered file system.
51: *
52: * @param scheme The URI scheme for the layered file system.
53: * @param file The file to build the file system on.
54: * @param fileSystemOptions
55: */
56: FileObject createFileSystem(String scheme, FileObject file,
57: 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)
73: throws FileSystemException;
74: }
|