| 1 | |
package org.webslinger.commons.vfs; |
| 2 | |
|
| 3 | |
import java.util.Arrays; |
| 4 | |
import java.util.Collection; |
| 5 | |
import java.util.Collections; |
| 6 | |
import org.apache.commons.vfs.Capability; |
| 7 | |
import org.apache.commons.vfs.FileName; |
| 8 | |
import org.apache.commons.vfs.FileObject; |
| 9 | |
import org.apache.commons.vfs.FileSystem; |
| 10 | |
import org.apache.commons.vfs.FileSystemException; |
| 11 | |
import org.apache.commons.vfs.FileSystemOptions; |
| 12 | |
import org.apache.commons.vfs.provider.LayeredFileName; |
| 13 | |
import org.apache.commons.vfs.provider.AbstractLayeredFileProvider; |
| 14 | |
|
| 15 | 141 | public abstract class FilteringFileProvider extends AbstractLayeredFileProvider { |
| 16 | 1 | public final static Collection capabilities = Collections.unmodifiableCollection( |
| 17 | |
Arrays.asList( |
| 18 | |
new Capability[] { |
| 19 | |
Capability.DISPATCHER |
| 20 | |
} |
| 21 | |
) |
| 22 | |
); |
| 23 | |
|
| 24 | |
|
| 25 | |
public Collection getCapabilities() { |
| 26 | 0 | return capabilities; |
| 27 | |
} |
| 28 | |
|
| 29 | |
protected FileSystem doCreateFileSystem(String scheme, FileObject file, FileSystemOptions properties) throws FileSystemException { |
| 30 | 39 | return doCreateFileSystem(new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, file.getType()), file, properties); |
| 31 | |
} |
| 32 | |
|
| 33 | |
protected abstract FileSystem doCreateFileSystem(LayeredFileName name, FileObject file, FileSystemOptions properties) throws FileSystemException; |
| 34 | |
} |