| 1 | |
package org.webslinger.commons.vfs.local; |
| 2 | |
|
| 3 | |
import java.io.File; |
| 4 | |
import java.util.Collection; |
| 5 | |
|
| 6 | |
|
| 7 | |
import org.apache.commons.vfs.FileListener; |
| 8 | |
import org.apache.commons.vfs.FileName; |
| 9 | |
import org.apache.commons.vfs.FileObject; |
| 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.provider.AbstractFileSystem; |
| 14 | |
import org.apache.commons.vfs.provider.local.LocalFileName; |
| 15 | |
import org.apache.commons.vfs.provider.local.LocalFileNameParser; |
| 16 | |
|
| 17 | |
import org.webslinger.commons.vfs.AbstractGenerifiedFileSystem; |
| 18 | |
|
| 19 | 44516 | public class LocalFileSystem extends AbstractGenerifiedFileSystem<LocalFileName, LocalFileObject, LocalFileSystem> { |
| 20 | |
protected final File rootFile; |
| 21 | |
|
| 22 | |
public LocalFileSystem(LocalFileName name, FileSystemOptions options, File rootFile) throws FileSystemException { |
| 23 | 59 | super(name, null, options); |
| 24 | 59 | this.rootFile = rootFile; |
| 25 | 59 | } |
| 26 | |
|
| 27 | |
protected void addCapabilities(Collection capabilities) { |
| 28 | 59 | } |
| 29 | |
|
| 30 | |
protected LocalFileObject createFile(FileName name) throws FileSystemException { |
| 31 | 20229 | return new LocalFileObject((LocalFileName) name, this, new File(rootFile, name.getPathDecoded())); |
| 32 | |
} |
| 33 | |
|
| 34 | |
protected LocalFileObject[] newArray(int length) { |
| 35 | 23733 | return new LocalFileObject[length]; |
| 36 | |
} |
| 37 | |
|
| 38 | |
public void addListener(LocalFileObject file, FileListener listener) { |
| 39 | |
|
| 40 | 554 | super.addListener(file, listener); |
| 41 | 554 | } |
| 42 | |
|
| 43 | |
public void removeListener(LocalFileObject file, FileListener listener) { |
| 44 | |
|
| 45 | 0 | super.removeListener(file, listener); |
| 46 | 0 | } |
| 47 | |
} |