| 1 | |
package org.webslinger.commons.vfs.cow; |
| 2 | |
|
| 3 | |
import org.apache.commons.vfs.FileName; |
| 4 | |
import org.apache.commons.vfs.FileSystemException; |
| 5 | |
|
| 6 | |
import org.webslinger.commons.vfs.operations.SymlinkOperation; |
| 7 | |
|
| 8 | |
public class COWSymlinkOperation<T extends COWFileObject> implements SymlinkOperation { |
| 9 | |
protected final COWFileSystem fs; |
| 10 | |
protected final FileName name; |
| 11 | |
|
| 12 | 6 | protected COWSymlinkOperation(T file) { |
| 13 | 6 | fs = file.getFileSystem(); |
| 14 | 6 | name = file.getName(); |
| 15 | 6 | } |
| 16 | |
|
| 17 | |
public String getSymlink() throws FileSystemException { |
| 18 | 0 | return fs.getCOWEntry(name.getPath()).getSymlink(); |
| 19 | |
} |
| 20 | |
|
| 21 | |
public boolean setSymlink(String symlink) throws FileSystemException { |
| 22 | 6 | return fs.getCOWEntry(name.getPath()).setSymlink(symlink); |
| 23 | |
} |
| 24 | |
|
| 25 | |
public final void process() throws FileSystemException { |
| 26 | 0 | throw new UnsupportedOperationException(); |
| 27 | |
} |
| 28 | |
} |