KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > coldcore > coloradoftp > filesystem > impl > DummyFileSystem


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 JavaDoc;
10 import java.nio.channels.WritableByteChannel JavaDoc;
11 import java.util.HashSet JavaDoc;
12 import java.util.Set JavaDoc;
13
14 /**
15  * @see com.coldcore.coloradoftp.filesystem.FileSystem
16  *
17  * A dummy filesystem implementation which does nothing.
18  * This is required to start up the FTP server without additional file system plugins.
19  */

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