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.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-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
34 * @see VfsComponent#setContext
35 */
36 public interface VfsComponentContext
37 {
38 /***
39 * Locate a file by name. See
40 * {@link FileSystemManager#resolveFile(FileObject, String)} for a
41 * description of how this works.
42 */
43 FileObject resolveFile(FileObject baseFile, String name, 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, FileSystemOptions fileSystemOptions)
52 throws FileSystemException;
53
54 FileName parseURI(String uri) throws FileSystemException;
55
56 /***
57 * Locates a file replicator for the provider to use.
58 */
59 FileReplicator getReplicator() throws FileSystemException;
60
61 /***
62 * Locates a temporary file store for the provider to use.
63 */
64 TemporaryFileStore getTemporaryFileStore() throws FileSystemException;
65
66 /***
67 * Returns a {@link FileObject} for a local file.
68 */
69 FileObject toFileObject(File file)
70 throws FileSystemException;
71
72 /***
73 * Returns the filesystem manager for the current context
74 *
75 * @return the filesystem manager
76 */
77 FileSystemManager getFileSystemManager();
78 }