KickJava   Java API By Example, From Geeks To Geeks.

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


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.FileSystemException;
21 import org.apache.commons.vfs.FileSystemManager;
22 import org.apache.commons.vfs.FileSystemOptions;
23
24 import java.io.File JavaDoc;
25
26 /**
27  * Allows VFS components to access the services they need, such as the file
28  * replicator. A VFS component is supplied with a context as part of its
29  * initialisation.
30  *
31  * @author <a HREF="mailto:adammurdoch@apache.org">Adam Murdoch</a>
32  * @see VfsComponent#setContext
33  */

34 public interface VfsComponentContext
35 {
36     /**
37      * Locate a file by name. See
38      * {@link FileSystemManager#resolveFile(FileObject, String)} for a
39      * description of how this works.
40      */

41     FileObject resolveFile(FileObject baseFile, String JavaDoc name, FileSystemOptions fileSystemOptions)
42         throws FileSystemException;
43
44     /**
45      * Locate a file by name. See
46      * {@link FileSystemManager#resolveFile( String)} for a
47      * description of how this works.
48      */

49     FileObject resolveFile(String JavaDoc name, FileSystemOptions fileSystemOptions)
50         throws FileSystemException;
51
52     FileName parseURI(String JavaDoc uri) throws FileSystemException;
53
54     /**
55      * Locates a file replicator for the provider to use.
56      */

57     FileReplicator getReplicator() throws FileSystemException;
58
59     /**
60      * Locates a temporary file store for the provider to use.
61      */

62     TemporaryFileStore getTemporaryFileStore() throws FileSystemException;
63
64     /**
65      * Returns a {@link FileObject} for a local file.
66      */

67     FileObject toFileObject(File JavaDoc file)
68         throws FileSystemException;
69
70     /**
71      * Returns the filesystem manager for the current context
72      *
73      * @return the filesystem manager
74      */

75     FileSystemManager getFileSystemManager();
76 }
77
Popular Tags