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.FileSystemException;
22: import org.apache.commons.vfs.FileSystemManager;
23: import org.apache.commons.vfs.FileSystemOptions;
24:
25: import java.io.File;
26:
27: /**
28: * Allows VFS components to access the services they need, such as the file
29: * replicator. A VFS component is supplied with a context as part of its
30: * initialisation.
31: *
32: * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
33: * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
34: * @see VfsComponent#setContext
35: */
36: public interface VfsComponentContext {
37: /**
38: * Locate a file by name. See
39: * {@link FileSystemManager#resolveFile(FileObject, String)} for a
40: * description of how this works.
41: */
42: FileObject resolveFile(FileObject baseFile, String name,
43: FileSystemOptions fileSystemOptions)
44: throws FileSystemException;
45:
46: /**
47: * Locate a file by name. See
48: * {@link FileSystemManager#resolveFile( String)} for a
49: * description of how this works.
50: */
51: FileObject resolveFile(String name,
52: FileSystemOptions fileSystemOptions)
53: throws FileSystemException;
54:
55: FileName parseURI(String uri) throws FileSystemException;
56:
57: /**
58: * Locates a file replicator for the provider to use.
59: */
60: FileReplicator getReplicator() throws FileSystemException;
61:
62: /**
63: * Locates a temporary file store for the provider to use.
64: */
65: TemporaryFileStore getTemporaryFileStore()
66: throws FileSystemException;
67:
68: /**
69: * Returns a {@link FileObject} for a local file.
70: */
71: FileObject toFileObject(File file) throws FileSystemException;
72:
73: /**
74: * Returns the filesystem manager for the current context
75: *
76: * @return the filesystem manager
77: */
78: FileSystemManager getFileSystemManager();
79: }
|