Source Code Cross Referenced for DummyBaseFtpConnection.java in  » Net » DrFTPD » org » drftpd » tests » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » DrFTPD » org.drftpd.tests 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of DrFTPD, Distributed FTP Daemon.
003:         *
004:         * DrFTPD is free software; you can redistribute it and/or modify
005:         * it under the terms of the GNU General Public License as published by
006:         * the Free Software Foundation; either version 2 of the License, or
007:         * (at your option) any later version.
008:         *
009:         * DrFTPD is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:         * GNU General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU General Public License
015:         * along with DrFTPD; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */
018:        package org.drftpd.tests;
019:
020:        import net.sf.drftpd.event.Event;
021:        import net.sf.drftpd.master.BaseFtpConnection;
022:        import net.sf.drftpd.master.FtpRequest;
023:        import net.sf.drftpd.master.command.CommandManager;
024:        import net.sf.drftpd.master.command.plugins.DataConnectionHandler;
025:
026:        import org.drftpd.Bytes;
027:        import org.drftpd.remotefile.LinkedRemoteFile;
028:        import org.drftpd.remotefile.StaticRemoteFile;
029:        import org.drftpd.usermanager.NoSuchUserException;
030:        import org.drftpd.usermanager.User;
031:
032:        import java.io.IOException;
033:        import java.io.PrintWriter;
034:        import java.io.StringWriter;
035:
036:        import java.net.InetAddress;
037:        import java.net.Socket;
038:
039:        import java.util.Collections;
040:
041:        import javax.net.ServerSocketFactory;
042:        import javax.net.SocketFactory;
043:
044:        /**
045:         * @author mog
046:         * @version $Id: DummyBaseFtpConnection.java 1243 2005-09-04 02:21:12Z zubov $
047:         */
048:        public class DummyBaseFtpConnection extends BaseFtpConnection {
049:            private InetAddress _clientAddress;
050:            private DataConnectionHandler _dch;
051:            private StringWriter _out2;
052:            private DummyServerSocketFactory _serverSocketFactory;
053:            private DummySocketFactory _socketFactory;
054:
055:            public DummyBaseFtpConnection(DataConnectionHandler dch) {
056:                _dch = dch;
057:                _socketFactory = new DummySocketFactory();
058:                _serverSocketFactory = new DummyServerSocketFactory(
059:                        _socketFactory);
060:
061:                _currentDirectory = new LinkedRemoteFile(null);
062:                _currentDirectory.addFile(new StaticRemoteFile(
063:                        Collections.EMPTY_LIST, "testfile", "drftpd", "drftpd",
064:                        Bytes.parseBytes("10M"), System.currentTimeMillis()));
065:                _out2 = new StringWriter();
066:                _out = new PrintWriter(_out2);
067:            }
068:
069:            protected Object clone() throws CloneNotSupportedException {
070:                throw new UnsupportedOperationException();
071:            }
072:
073:            /**
074:             * @deprecated
075:             */
076:            protected void dispatchFtpEvent(Event event) {
077:                throw new UnsupportedOperationException();
078:            }
079:
080:            /* (non-Javadoc)
081:             * @see java.lang.Object#equals(java.lang.Object)
082:             */
083:            public boolean equals(Object obj) {
084:                throw new UnsupportedOperationException();
085:            }
086:
087:            public InetAddress getClientAddress() {
088:                if (_clientAddress == null) {
089:                    throw new NullPointerException();
090:                }
091:
092:                return _clientAddress;
093:            }
094:
095:            public CommandManager getCommandManager() {
096:                throw new UnsupportedOperationException();
097:            }
098:
099:            public Socket getControlSocket() {
100:                return new DummySocket();
101:            }
102:
103:            public DataConnectionHandler getDataConnectionHandler() {
104:                if (_dch == null) {
105:                    throw new NullPointerException(
106:                            "No DataConnectionHandler set");
107:                }
108:
109:                return _dch;
110:            }
111:
112:            public char getDirection() {
113:                throw new UnsupportedOperationException();
114:            }
115:
116:            public StringWriter getDummyOut() {
117:                return _out2;
118:            }
119:
120:            public DummyServerSocketFactory getDummySSF() {
121:                return _serverSocketFactory;
122:            }
123:
124:            public long getLastActive() {
125:                throw new UnsupportedOperationException();
126:            }
127:
128:            public ServerSocketFactory getServerSocketFactory() {
129:                return _serverSocketFactory;
130:            }
131:
132:            public SocketFactory getSocketFactory() {
133:                return _socketFactory;
134:            }
135:
136:            public char getTransferDirection() {
137:                throw new UnsupportedOperationException();
138:            }
139:
140:            public User getUser() throws NoSuchUserException {
141:                throw new UnsupportedOperationException();
142:            }
143:
144:            /* (non-Javadoc)
145:             * @see net.sf.drftpd.master.BaseFtpConnection#getUserNull()
146:             */
147:            public User getUserNull() {
148:                return super .getUserNull();
149:            }
150:
151:            /* (non-Javadoc)
152:             * @see java.lang.Object#hashCode()
153:             */
154:            public int hashCode() {
155:                throw new UnsupportedOperationException();
156:            }
157:
158:            protected boolean hasPermission(FtpRequest request) {
159:                throw new UnsupportedOperationException();
160:            }
161:
162:            public boolean isExecuting() {
163:                throw new UnsupportedOperationException();
164:            }
165:
166:            /**
167:             * @deprecated
168:             */
169:            public void reset() {
170:                throw new UnsupportedOperationException();
171:            }
172:
173:            public void resetState() {
174:            }
175:
176:            /* (non-Javadoc)
177:             * @see java.lang.Runnable#run()
178:             */
179:            public void run() {
180:                throw new UnsupportedOperationException();
181:            }
182:
183:            /* (non-Javadoc)
184:             * @see net.sf.drftpd.master.BaseFtpConnection#service(net.sf.drftpd.master.FtpRequest, java.io.PrintWriter)
185:             */
186:            public void service(FtpRequest request, PrintWriter out)
187:                    throws IOException {
188:                throw new UnsupportedOperationException();
189:            }
190:
191:            public void setClientAddress(InetAddress clientAddress) {
192:                _clientAddress = clientAddress;
193:            }
194:
195:            /* (non-Javadoc)
196:             * @see net.sf.drftpd.master.BaseFtpConnection#setControlSocket(java.net.Socket)
197:             */
198:            public void setControlSocket(Socket socket) {
199:                throw new UnsupportedOperationException();
200:            }
201:
202:            public void setRequest(FtpRequest request) {
203:                _request = request;
204:            }
205:
206:            public void setUser(String user) {
207:                super .setUser(user);
208:            }
209:
210:            /* (non-Javadoc)
211:             * @see net.sf.drftpd.master.BaseFtpConnection#start()
212:             */
213:            public void start() {
214:                throw new UnsupportedOperationException();
215:            }
216:
217:            /* (non-Javadoc)
218:             * @see net.sf.drftpd.master.BaseFtpConnection#status()
219:             */
220:            public String status() {
221:                return "dummy status string";
222:            }
223:
224:            /* (non-Javadoc)
225:             * @see net.sf.drftpd.master.BaseFtpConnection#stop()
226:             */
227:            public void stop() {
228:                throw new UnsupportedOperationException();
229:            }
230:
231:            /* (non-Javadoc)
232:             * @see net.sf.drftpd.master.BaseFtpConnection#stop(java.lang.String)
233:             */
234:            public void stop(String message) {
235:                throw new UnsupportedOperationException();
236:            }
237:
238:            /* (non-Javadoc)
239:             * @see java.lang.Object#toString()
240:             */
241:            public String toString() {
242:                throw new UnsupportedOperationException();
243:            }
244:
245:            public void setGlobalConext(DummyGlobalContext gctx) {
246:                _gctx = gctx;
247:            }
248:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.