KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > vfs > FilesCache


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;
17
18
19 /**
20  * The fileCache interface
21  *
22  * @author <a HREF="mailto:imario@apache.org">Mario Ivankovits</a>
23  */

24 public interface FilesCache
25 {
26     /**
27      * add a fileobject to the cache
28      *
29      * @param file the file
30      */

31     public void putFile(final FileObject file);
32
33     /**
34      * retrieve a file from the cache by its name
35      *
36      * @param name the name
37      * @return the fileobject or null if file is not cached
38      */

39     public FileObject getFile(final FileSystem filesystem, final FileName name);
40
41     /**
42      * purge the entries corresponding to the filesystem
43      */

44     public void clear(final FileSystem filesystem);
45
46     /**
47      * purge the whole cache
48      */

49     public void close();
50
51     /**
52      * removes a file from cache
53      *
54      * @param filesystem filesystem
55      * @param name filename
56      */

57     public void removeFile(final FileSystem filesystem, final FileName name);
58
59     /**
60      * if the cache uses timestamps it could use this method to handle
61      * updates of them
62      *
63      * @param file filename
64      */

65     // public void touchFile(final FileObject file);
66
}
67
Popular Tags