| 1 | |
package org.webslinger.commons.vfs.ccache; |
| 2 | |
|
| 3 | |
import java.util.Collection; |
| 4 | |
|
| 5 | |
import org.apache.commons.vfs.Capability; |
| 6 | |
import org.apache.commons.vfs.FileName; |
| 7 | |
import org.apache.commons.vfs.FileObject; |
| 8 | |
import org.apache.commons.vfs.FileSystemException; |
| 9 | |
import org.apache.commons.vfs.FileSystemOptions; |
| 10 | |
import org.apache.commons.vfs.provider.AbstractFileSystem; |
| 11 | |
|
| 12 | |
import org.webslinger.commons.vfs.FileSet; |
| 13 | |
import org.webslinger.commons.vfs.FilteringFileObject; |
| 14 | |
import org.webslinger.commons.vfs.FilteringFileSystem; |
| 15 | |
|
| 16 | 0 | public class ContentCacheFileSystem extends FilteringFileSystem<FileName, ContentCacheFileObject, ContentCacheFileSystem> { |
| 17 | |
private final FileObject root; |
| 18 | |
private final double lastModTimeAccuracy; |
| 19 | |
|
| 20 | |
public ContentCacheFileSystem(FileName name, FileObject root, FileSystemOptions options) throws FileSystemException { |
| 21 | 0 | super(name, root, options); |
| 22 | 0 | this.root = root; |
| 23 | 0 | lastModTimeAccuracy = root.getFileSystem().getLastModTimeAccuracy(); |
| 24 | 0 | } |
| 25 | |
|
| 26 | |
public void log(String message) { |
| 27 | |
|
| 28 | 0 | } |
| 29 | |
|
| 30 | |
protected FileSet getRealFiles(ContentCacheFileObject file) throws FileSystemException { |
| 31 | 0 | return createFileSet(new FileObject[] {file.getRealFile()}, new FileObject[0]); |
| 32 | |
} |
| 33 | |
|
| 34 | |
protected ContentCacheFileObject[] newArray(int length) { |
| 35 | 0 | return new ContentCacheFileObject[length]; |
| 36 | |
} |
| 37 | |
|
| 38 | |
public ContentCacheFileObject createFile(FileName name) throws FileSystemException { |
| 39 | 0 | log("createFile.name(" + name + ")"); |
| 40 | 0 | log(name.getPath()); |
| 41 | 0 | log("root=" + root); |
| 42 | 0 | return new ContentCacheFileObject(name, root.resolveFile(name.getPath().substring(1)), this); |
| 43 | |
} |
| 44 | |
|
| 45 | |
public double getLastModTimeAccuracy() { |
| 46 | 0 | return lastModTimeAccuracy; |
| 47 | |
} |
| 48 | |
} |
| 49 | |
|