| 1 | |
package org.webslinger.commons.vfs; |
| 2 | |
|
| 3 | |
import java.io.File; |
| 4 | |
import java.net.URLStreamHandler; |
| 5 | |
|
| 6 | |
import org.apache.commons.vfs.FileListener; |
| 7 | |
import org.apache.commons.vfs.FileName; |
| 8 | |
import org.apache.commons.vfs.FileObject; |
| 9 | |
import org.apache.commons.vfs.FileSelector; |
| 10 | |
import org.apache.commons.vfs.FileSystem; |
| 11 | |
import org.apache.commons.vfs.FileSystemException; |
| 12 | |
import org.apache.commons.vfs.FileSystemOptions; |
| 13 | |
import org.apache.commons.vfs.FileType; |
| 14 | |
import org.apache.commons.vfs.provider.AbstractFileSystem; |
| 15 | |
import org.apache.commons.vfs.provider.DefaultURLStreamHandler; |
| 16 | |
|
| 17 | 89483 | public abstract class AbstractGenerifiedFileSystem<N extends FileName, F extends AbstractGenerifiedFileObject<N, F, S>, S extends AbstractGenerifiedFileSystem<N, F, S>> extends AbstractFileSystem implements GenerifiedFileSystem<N, F, S> { |
| 18 | |
public AbstractGenerifiedFileSystem(N name, FileObject root, FileSystemOptions options) throws FileSystemException { |
| 19 | 151 | super(name, root, options); |
| 20 | 151 | } |
| 21 | |
|
| 22 | |
protected URLStreamHandler getStreamHandler() { |
| 23 | 879 | return new DefaultURLStreamHandler(getContext(), getFileSystemOptions()); |
| 24 | |
} |
| 25 | |
|
| 26 | |
public N getRootName() { |
| 27 | 16 | return (N) super.getRootName(); |
| 28 | |
} |
| 29 | |
|
| 30 | |
public F getRoot() throws FileSystemException { |
| 31 | 57897 | return (F) super.getRoot(); |
| 32 | |
} |
| 33 | |
|
| 34 | |
public F resolveFile(String path) throws FileSystemException { |
| 35 | 802 | return (F) super.resolveFile(path); |
| 36 | |
} |
| 37 | |
|
| 38 | |
public F resolveFile(FileName name) throws FileSystemException { |
| 39 | 964929 | return (F) super.resolveFile(name); |
| 40 | |
} |
| 41 | |
|
| 42 | |
public File replicateFile(F file, FileSelector selector) throws FileSystemException { |
| 43 | 0 | return super.replicateFile(file, selector); |
| 44 | |
} |
| 45 | |
|
| 46 | |
public void addListener(FileObject file, FileListener listener) { |
| 47 | 554 | addListener((F) file, listener); |
| 48 | 554 | } |
| 49 | |
|
| 50 | |
public void removeListener(FileObject file, FileListener listener) { |
| 51 | 0 | removeListener((F) file, listener); |
| 52 | 0 | } |
| 53 | |
|
| 54 | |
public void addListener(F file, FileListener listener) { |
| 55 | 554 | super.addListener(file, listener); |
| 56 | 554 | } |
| 57 | |
|
| 58 | |
public void removeListener(F file, FileListener listener) { |
| 59 | 0 | super.removeListener(file, listener); |
| 60 | 0 | } |
| 61 | |
|
| 62 | |
protected void updateListeners(FileName name) throws FileSystemException { |
| 63 | 0 | } |
| 64 | |
|
| 65 | |
protected abstract F[] newArray(int length); |
| 66 | |
} |
| 67 | |
|