1 package com.coldcore.coloradoftp.filesystem.impl; 2 3 import com.coldcore.coloradoftp.filesystem.FailedActionException; 4 import com.coldcore.coloradoftp.filesystem.FailedActionReason; 5 import com.coldcore.coloradoftp.filesystem.FileSystem; 6 import com.coldcore.coloradoftp.filesystem.ListingFile; 7 import com.coldcore.coloradoftp.session.Session; 8 9 import java.nio.channels.ReadableByteChannel ; 10 import java.nio.channels.WritableByteChannel ; 11 import java.util.HashSet ; 12 import java.util.Set ; 13 14 20 public class DummyFileSystem implements FileSystem { 21 22 public String getCurrentDirectory(Session userSession) throws FailedActionException { 23 return "/"; 24 } 25 26 27 public String getParent(String path, Session userSession) throws FailedActionException { 28 return "/"; 29 } 30 31 32 public String toAbsolute(String path, Session userSession) throws FailedActionException { 33 return "/"; 34 } 35 36 37 public ListingFile getPath(String path, Session userSession) throws FailedActionException { 38 throw new FailedActionException(FailedActionReason.NOT_IMPLEMENTED); 39 } 40 41 42 public Set <ListingFile> listDirectory(String dir, Session userSession) throws FailedActionException { 43 return new HashSet <ListingFile>(); 44 } 45 46 47 public String changeDirectory(String dir, Session userSession) throws FailedActionException { 48 throw new FailedActionException(FailedActionReason.NOT_IMPLEMENTED); 49 } 50 51 52 public void deletePath(String path, Session userSession) throws FailedActionException { 53 throw new FailedActionException(FailedActionReason.NOT_IMPLEMENTED); 54 } 55 56 57 public String createDirectory(String dir, Session userSession) throws FailedActionException { 58 throw new FailedActionException(FailedActionReason.NOT_IMPLEMENTED); 59 } 60 61 62 public String renamePath(String from, String to, Session userSession) throws FailedActionException { 63 throw new FailedActionException(FailedActionReason.NOT_IMPLEMENTED); 64 } 65 66 67 public ReadableByteChannel readFile(String filename, long position, Session userSession) throws FailedActionException { 68 throw new FailedActionException(FailedActionReason.NOT_IMPLEMENTED); 69 } 70 71 72 public WritableByteChannel saveFile(String filename, boolean append, Session userSession) throws FailedActionException { 73 throw new FailedActionException(FailedActionReason.NOT_IMPLEMENTED); 74 } 75 76 77 public String getFileSeparator() { 78 return "/"; 79 } 80 } 81 | Popular Tags |