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;
18:
19: /**
20: * The fileCache interface
21: *
22: * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
23: * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
24: */
25: public interface FilesCache {
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,
40: final FileName name);
41:
42: /**
43: * purge the entries corresponding to the filesystem
44: */
45: public void clear(final FileSystem filesystem);
46:
47: /**
48: * purge the whole cache
49: */
50: public void close();
51:
52: /**
53: * removes a file from cache
54: *
55: * @param filesystem filesystem
56: * @param name filename
57: */
58: public void removeFile(final FileSystem filesystem,
59: final FileName name);
60:
61: /**
62: * if the cache uses timestamps it could use this method to handle
63: * updates of them
64: *
65: * @param file filename
66: */
67: // public void touchFile(final FileObject file);
68: }
|