01: package com.coldcore.coloradoftp.filesystem.impl;
02:
03: import com.coldcore.coloradoftp.filesystem.FailedActionException;
04: import com.coldcore.coloradoftp.filesystem.FailedActionReason;
05: import com.coldcore.coloradoftp.filesystem.FileSystem;
06: import com.coldcore.coloradoftp.filesystem.ListingFile;
07: import com.coldcore.coloradoftp.session.Session;
08:
09: import java.nio.channels.ReadableByteChannel;
10: import java.nio.channels.WritableByteChannel;
11: import java.util.HashSet;
12: import java.util.Set;
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 getCurrentDirectory(Session userSession)
23: throws FailedActionException {
24: return "/";
25: }
26:
27: public String getParent(String path, Session userSession)
28: throws FailedActionException {
29: return "/";
30: }
31:
32: public String toAbsolute(String path, Session userSession)
33: throws FailedActionException {
34: return "/";
35: }
36:
37: public ListingFile getPath(String path, Session userSession)
38: throws FailedActionException {
39: throw new FailedActionException(
40: FailedActionReason.NOT_IMPLEMENTED);
41: }
42:
43: public Set<ListingFile> listDirectory(String dir,
44: Session userSession) throws FailedActionException {
45: return new HashSet<ListingFile>();
46: }
47:
48: public String changeDirectory(String dir, Session userSession)
49: throws FailedActionException {
50: throw new FailedActionException(
51: FailedActionReason.NOT_IMPLEMENTED);
52: }
53:
54: public void deletePath(String path, Session userSession)
55: throws FailedActionException {
56: throw new FailedActionException(
57: FailedActionReason.NOT_IMPLEMENTED);
58: }
59:
60: public String createDirectory(String dir, Session userSession)
61: throws FailedActionException {
62: throw new FailedActionException(
63: FailedActionReason.NOT_IMPLEMENTED);
64: }
65:
66: public String renamePath(String from, String to, Session userSession)
67: throws FailedActionException {
68: throw new FailedActionException(
69: FailedActionReason.NOT_IMPLEMENTED);
70: }
71:
72: public ReadableByteChannel readFile(String filename, long position,
73: Session userSession) throws FailedActionException {
74: throw new FailedActionException(
75: FailedActionReason.NOT_IMPLEMENTED);
76: }
77:
78: public WritableByteChannel saveFile(String filename,
79: boolean append, Session userSession)
80: throws FailedActionException {
81: throw new FailedActionException(
82: FailedActionReason.NOT_IMPLEMENTED);
83: }
84:
85: public String getFileSeparator() {
86: return "/";
87: }
88: }
|