741 |
10 Oct 06 |
olle |
1 |
/* |
1652 |
22 May 07 |
gregory |
$Id$ |
741 |
10 Oct 06 |
olle |
3 |
|
1916 |
31 Aug 07 |
jari |
Copyright (C) 2006 Olle Mansson |
1916 |
31 Aug 07 |
jari |
Copyright (C) 2007 Gregory Vincic |
741 |
10 Oct 06 |
olle |
6 |
|
1652 |
22 May 07 |
gregory |
This file is part of Proteios. |
1652 |
22 May 07 |
gregory |
Available at http://www.proteios.org/ |
741 |
10 Oct 06 |
olle |
9 |
|
1652 |
22 May 07 |
gregory |
Proteios is free software; you can redistribute it and/or modify it |
1652 |
22 May 07 |
gregory |
under the terms of the GNU General Public License as published by |
1652 |
22 May 07 |
gregory |
the Free Software Foundation; either version 2 of the License, or |
1652 |
22 May 07 |
gregory |
(at your option) any later version. |
741 |
10 Oct 06 |
olle |
14 |
|
1652 |
22 May 07 |
gregory |
Proteios is distributed in the hope that it will be useful, but |
1652 |
22 May 07 |
gregory |
WITHOUT ANY WARRANTY; without even the implied warranty of |
1652 |
22 May 07 |
gregory |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1652 |
22 May 07 |
gregory |
General Public License for more details. |
741 |
10 Oct 06 |
olle |
19 |
|
1652 |
22 May 07 |
gregory |
You should have received a copy of the GNU General Public License |
1652 |
22 May 07 |
gregory |
along with this program; if not, write to the Free Software |
1652 |
22 May 07 |
gregory |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
1652 |
22 May 07 |
gregory |
02111-1307, USA. |
1652 |
22 May 07 |
gregory |
24 |
*/ |
741 |
10 Oct 06 |
olle |
25 |
|
741 |
10 Oct 06 |
olle |
// Xerver Free Web Server |
741 |
10 Oct 06 |
olle |
// Copyright (C) 2002-2005 Omid Rouhani |
741 |
10 Oct 06 |
olle |
28 |
// |
741 |
10 Oct 06 |
olle |
29 |
// |
741 |
10 Oct 06 |
olle |
// This program is free software; you can redistribute it and/or |
741 |
10 Oct 06 |
olle |
// modify it under the terms of the GNU General Public License |
741 |
10 Oct 06 |
olle |
// as published by the Free Software Foundation; either version 2 |
741 |
10 Oct 06 |
olle |
// of the License, or (at your option) any later version. |
741 |
10 Oct 06 |
olle |
34 |
// |
741 |
10 Oct 06 |
olle |
// This program is distributed in the hope that it will be useful, |
741 |
10 Oct 06 |
olle |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
741 |
10 Oct 06 |
olle |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
741 |
10 Oct 06 |
olle |
// GNU General Public License for more details. |
741 |
10 Oct 06 |
olle |
39 |
// |
741 |
10 Oct 06 |
olle |
// You should have received a copy of the GNU General Public License |
741 |
10 Oct 06 |
olle |
// along with this program; if not, write to the Free Software |
741 |
10 Oct 06 |
olle |
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
741 |
10 Oct 06 |
olle |
43 |
// |
741 |
10 Oct 06 |
olle |
44 |
// |
741 |
10 Oct 06 |
olle |
45 |
// ############################################################# |
741 |
10 Oct 06 |
olle |
// ## YOU CAN CONTACT THE AUTHOR (OMID ROUHANI) AT: ## |
741 |
10 Oct 06 |
olle |
// ## HTTP://WWW.JAVASCRIPT.NU/XERVER/ ## |
741 |
10 Oct 06 |
olle |
48 |
// ## ## |
741 |
10 Oct 06 |
olle |
// ## IF YOUR SOFTWARE IS NOT RELEASED UNDER THE ## |
741 |
10 Oct 06 |
olle |
// ## GNU GENERAL PUBLIC LICENSE (GPL), ## |
741 |
10 Oct 06 |
olle |
// ## PLEASE DO NOT COPY ANYTHING FROM THIS SOURCE CODE!!! ## |
741 |
10 Oct 06 |
olle |
52 |
// ## ## |
741 |
10 Oct 06 |
olle |
// ## FOR FULL LICENSE, PLEASE READ "XERVER LICENSE". ## |
741 |
10 Oct 06 |
olle |
54 |
// ############################################################# |
741 |
10 Oct 06 |
olle |
55 |
|
1652 |
22 May 07 |
gregory |
56 |
package se.lu.thep.coreftpd.ftp_server; |
741 |
10 Oct 06 |
olle |
57 |
|
791 |
23 Oct 06 |
olle |
58 |
import se.lu.thep.coreftpd.common.HostInfo; |
741 |
10 Oct 06 |
olle |
59 |
import java.io.File; |
741 |
10 Oct 06 |
olle |
60 |
|
741 |
10 Oct 06 |
olle |
61 |
/** |
1652 |
22 May 07 |
gregory |
62 |
* |
1652 |
22 May 07 |
gregory |
* <B>About this class:</B> <BR> |
1652 |
22 May 07 |
gregory |
* Want to bound Xerver Free FTP Server to your GNU GPL application? <BR> |
1652 |
22 May 07 |
gregory |
* Then this is the only class your program will use directly. <BR> |
1652 |
22 May 07 |
gregory |
* You shall not have to learn about the other classes that are used. <BR> |
1652 |
22 May 07 |
gregory |
* All methods in this class are static. <BR> |
741 |
10 Oct 06 |
olle |
* <BR> |
1652 |
22 May 07 |
gregory |
* When Xerver Free FTP Server was written it was designed to be easy to bound |
1652 |
22 May 07 |
gregory |
* with other applications. <BR> |
1652 |
22 May 07 |
gregory |
* Xerver Free Web Server is for example using Xerver Free FTP Server. <BR> |
741 |
10 Oct 06 |
olle |
* <BR> |
1652 |
22 May 07 |
gregory |
* <B>To start using Xerver Free FTP Server in your own application follow these |
1652 |
22 May 07 |
gregory |
* steps:</B> <BR> |
1652 |
22 May 07 |
gregory |
* 1.) Download the source files for Xerver Free Web Server. <BR> |
1652 |
22 May 07 |
gregory |
* 2.) Copy the folders called "ftp_server" and "common" to the directory where |
1652 |
22 May 07 |
gregory |
* you have stored your Java GNU GPL application. <BR> |
1652 |
22 May 07 |
gregory |
* 3.) Add "<CODE>import ftp_server.*;import common.*;</CODE>" to the top of |
1652 |
22 May 07 |
gregory |
* all your .java-files. <BR> |
1652 |
22 May 07 |
gregory |
* 4.) You're done! Now you can call the methods of this class and start the FTP |
1652 |
22 May 07 |
gregory |
* server. <BR> |
741 |
10 Oct 06 |
olle |
* <BR> |
1652 |
22 May 07 |
gregory |
* <B>Examples:</B> <BR> |
1652 |
22 May 07 |
gregory |
* Here is an example to show you how you can easily implement Xerver Free FTP |
1652 |
22 May 07 |
gregory |
* Server into your application. <BR> |
741 |
10 Oct 06 |
olle |
* <FONT COLOR=gray> |
1652 |
22 May 07 |
gregory |
87 |
* |
741 |
10 Oct 06 |
olle |
* <PRE> |
1652 |
22 May 07 |
gregory |
89 |
* |
1652 |
22 May 07 |
gregory |
* <FONT COLOR=red>import ftp_server.*;</FONT> <FONT COLOR=red>import common.*;</FONT> |
1652 |
22 May 07 |
gregory |
91 |
* |
1652 |
22 May 07 |
gregory |
* class Dummy { public static void main(String [] s) { <FONT |
1652 |
22 May 07 |
gregory |
* COLOR=red>FTPServerController.startFTPServer();</FONT> System.out.println(<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>"Xerver Free FTP Server "</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=red>FTPServerController.getVersionString()</FONT>+<FONT COLOR=blue>" |
1652 |
22 May 07 |
gregory |
* is running."</FONT>); System.out.println(<FONT COLOR=blue>"Connect to "</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=red>FTPServerController.getIP()</FONT>); System.out.println(<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>"at port "</FONT>+<FONT COLOR=red>FTPServerController.getPort()</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>"."</FONT>); |
1652 |
22 May 07 |
gregory |
100 |
* |
1652 |
22 May 07 |
gregory |
* <FONT COLOR=red>FTPServerController.stopFTPServer();</FONT> |
1652 |
22 May 07 |
gregory |
* System.out.println(<FONT COLOR=blue>"You can no longer connect to "</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=red>FTPServerController.getIP()</FONT>+<FONT COLOR=blue>"."</FONT>); |
1652 |
22 May 07 |
gregory |
104 |
* |
1652 |
22 May 07 |
gregory |
* <FONT COLOR=red>FTPServerController.startFTPLocalSetup();</FONT> |
1652 |
22 May 07 |
gregory |
* System.out.println(<FONT COLOR=blue>"Only you (=your IP) can now visit |
1652 |
22 May 07 |
gregory |
* Xerver FTP Setup at:"</FONT>); System.out.println(<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>"http://"</FONT>+<FONT COLOR=red>FTPServerController.getIP()</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>":"</FONT>+<FONT COLOR=red>FTPServerController.getSetupPort()</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>"/"</FONT>); |
1652 |
22 May 07 |
gregory |
111 |
* |
1652 |
22 May 07 |
gregory |
* <FONT COLOR=red>FTPServerController.startFTPRemoteSetup();</FONT> |
1652 |
22 May 07 |
gregory |
* System.out.println(<FONT COLOR=blue>"Anyone (any IP) can now visit Xerver |
1652 |
22 May 07 |
gregory |
* FTP Setup at:"</FONT>); System.out.println(<FONT COLOR=blue>"http://"</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=red>FTPServerController.getIP()</FONT>+<FONT COLOR=blue>":"</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=red>FTPServerController.getSetupPort()</FONT>+<FONT COLOR=blue>"/"</FONT>); |
1652 |
22 May 07 |
gregory |
117 |
* |
1652 |
22 May 07 |
gregory |
* <FONT COLOR=red>FTPServerController.startFTPLocalSetup();</FONT> |
1652 |
22 May 07 |
gregory |
* System.out.println(<FONT COLOR=blue>"Only you (=your IP) can now visit |
1652 |
22 May 07 |
gregory |
* Xerver FTP Setup at:"</FONT>); System.out.println(<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>"http://"</FONT>+<FONT COLOR=red>FTPServerController.getIP()</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>":"</FONT>+<FONT COLOR=red>FTPServerController.getSetupPort()</FONT>+<FONT |
1652 |
22 May 07 |
gregory |
* COLOR=blue>"/"</FONT>); System.out.println(<FONT COLOR=blue>"Remote |
1652 |
22 May 07 |
gregory |
* computers can no longer reach setup."</FONT>); |
1652 |
22 May 07 |
gregory |
125 |
* |
1652 |
22 May 07 |
gregory |
* System.out.println(<FONT COLOR=blue>"Can it be easier to implement an FTP |
1652 |
22 May 07 |
gregory |
* server or what? :)"</FONT>); System.out.println(<FONT COLOR=blue>"Enjoy |
1652 |
22 May 07 |
gregory |
* Xerver Free FTP Server!"</FONT>); }//main }//class |
1652 |
22 May 07 |
gregory |
129 |
* |
741 |
10 Oct 06 |
olle |
* </PRE> |
1652 |
22 May 07 |
gregory |
131 |
* |
741 |
10 Oct 06 |
olle |
* </FONT> |
1652 |
22 May 07 |
gregory |
133 |
* |
741 |
10 Oct 06 |
olle |
* @author <a href="http://www.JavaScript.nu/xerver/" TARGET="_top">Omid Rouhani</a> |
741 |
10 Oct 06 |
olle |
* @version 1.0 |
741 |
10 Oct 06 |
olle |
136 |
*/ |
741 |
10 Oct 06 |
olle |
137 |
|
1652 |
22 May 07 |
gregory |
138 |
final public class FTPServerController { |
1652 |
22 May 07 |
gregory |
139 |
private static FTPServer server = null; |
741 |
10 Oct 06 |
olle |
140 |
|
1652 |
22 May 07 |
gregory |
141 |
private static FTPSetup setup = null; |
741 |
10 Oct 06 |
olle |
142 |
|
1652 |
22 May 07 |
gregory |
143 |
private static final double d_FTPversion = 1.05; |
741 |
10 Oct 06 |
olle |
144 |
|
1652 |
22 May 07 |
gregory |
145 |
private static final String s_FTPversion = "1.05"; |
741 |
10 Oct 06 |
olle |
146 |
|
1652 |
22 May 07 |
gregory |
147 |
private static String s_serverIP = null; |
1652 |
22 May 07 |
gregory |
148 |
|
1652 |
22 May 07 |
gregory |
// public final static String |
1652 |
22 May 07 |
gregory |
// s_initFile="ftp_data"+File.separator+"FTP.cfg"; |
1652 |
22 May 07 |
gregory |
// public final static String s_dataFolder="ftp_data"+File.separator; |
1652 |
22 May 07 |
gregory |
// public final static String s_userFolder="users"+File.separator; |
790 |
23 Oct 06 |
olle |
153 |
/* |
790 |
23 Oct 06 |
olle |
* Proteios settings |
790 |
23 Oct 06 |
olle |
155 |
*/ |
1652 |
22 May 07 |
gregory |
156 |
public final static String s_initFile = "/ftp.properties"; |
741 |
10 Oct 06 |
olle |
157 |
|
1652 |
22 May 07 |
gregory |
158 |
public final static String s_dataFolder = "org" + File.separator |
1652 |
22 May 07 |
gregory |
159 |
+ "proteios" + File.separator + "ftp" + File.separator + "ftp_data" |
1652 |
22 May 07 |
gregory |
160 |
+ File.separator; |
1652 |
22 May 07 |
gregory |
161 |
|
1652 |
22 May 07 |
gregory |
162 |
public final static String s_userFolder = "org" + File.separator |
1652 |
22 May 07 |
gregory |
163 |
+ "proteios" + File.separator + "ftp" + File.separator + "users" |
1652 |
22 May 07 |
gregory |
164 |
+ File.separator; |
1652 |
22 May 07 |
gregory |
165 |
|
1652 |
22 May 07 |
gregory |
166 |
public final static String s_userDataExtension = ".dat"; |
1652 |
22 May 07 |
gregory |
167 |
|
1652 |
22 May 07 |
gregory |
168 |
public static void main(String[] s) { |
741 |
10 Oct 06 |
olle |
169 |
startFTPServer(); |
741 |
10 Oct 06 |
olle |
170 |
startFTPLocalSetup(); |
741 |
10 Oct 06 |
olle |
171 |
} |
741 |
10 Oct 06 |
olle |
172 |
|
741 |
10 Oct 06 |
olle |
173 |
/** |
1652 |
22 May 07 |
gregory |
* Starts the FTP server. |
1652 |
22 May 07 |
gregory |
175 |
*/ |
1652 |
22 May 07 |
gregory |
176 |
public static void startFTPServer() { |
1652 |
22 May 07 |
gregory |
177 |
if (server == null) // If [server has not started] or [port number has |
1652 |
22 May 07 |
gregory |
// changed (then restart server)]... |
741 |
10 Oct 06 |
olle |
179 |
{ |
1652 |
22 May 07 |
gregory |
180 |
server = new FTPServer(); |
741 |
10 Oct 06 |
olle |
181 |
server.start(); |
741 |
10 Oct 06 |
olle |
182 |
} |
741 |
10 Oct 06 |
olle |
183 |
|
741 |
10 Oct 06 |
olle |
184 |
server.startFTPServer(); |
741 |
10 Oct 06 |
olle |
185 |
} |
741 |
10 Oct 06 |
olle |
186 |
|
741 |
10 Oct 06 |
olle |
187 |
/** |
1652 |
22 May 07 |
gregory |
* Stops the FTP server. |
1652 |
22 May 07 |
gregory |
189 |
*/ |
1652 |
22 May 07 |
gregory |
190 |
public static void stopFTPServer() { |
741 |
10 Oct 06 |
olle |
191 |
/* |
1652 |
22 May 07 |
gregory |
* if (server==null) { server=new FTPServer(); server.start(); } |
1652 |
22 May 07 |
gregory |
193 |
*/ |
1652 |
22 May 07 |
gregory |
194 |
if (server != null) { |
741 |
10 Oct 06 |
olle |
195 |
server.stopFTPServer(); |
741 |
10 Oct 06 |
olle |
196 |
} |
741 |
10 Oct 06 |
olle |
197 |
} |
741 |
10 Oct 06 |
olle |
198 |
|
741 |
10 Oct 06 |
olle |
199 |
/** |
1652 |
22 May 07 |
gregory |
* This will start FTP Setup and it allows everyone to reach the setup and |
1652 |
22 May 07 |
gregory |
* change settings to the server. |
1652 |
22 May 07 |
gregory |
202 |
*/ |
1652 |
22 May 07 |
gregory |
203 |
public static void startFTPRemoteSetup() { |
1652 |
22 May 07 |
gregory |
204 |
if (setup == null) { |
1652 |
22 May 07 |
gregory |
205 |
setup = new FTPSetup(); |
741 |
10 Oct 06 |
olle |
206 |
setup.start(); |
741 |
10 Oct 06 |
olle |
207 |
} |
741 |
10 Oct 06 |
olle |
208 |
|
741 |
10 Oct 06 |
olle |
209 |
setup.startFTPSetup(); |
741 |
10 Oct 06 |
olle |
210 |
} |
741 |
10 Oct 06 |
olle |
211 |
|
741 |
10 Oct 06 |
olle |
212 |
/** |
1652 |
22 May 07 |
gregory |
* This will start FTP Setup but only allows your local IP to visit the |
1652 |
22 May 07 |
gregory |
* setup and change settings to the server. |
1652 |
22 May 07 |
gregory |
215 |
*/ |
1652 |
22 May 07 |
gregory |
// Turn off remote setup if already turned on |
1652 |
22 May 07 |
gregory |
217 |
public static void startFTPLocalSetup() { |
1652 |
22 May 07 |
gregory |
218 |
if (setup == null) { |
1652 |
22 May 07 |
gregory |
219 |
setup = new FTPSetup(); |
741 |
10 Oct 06 |
olle |
220 |
setup.start(); |
741 |
10 Oct 06 |
olle |
221 |
} |
741 |
10 Oct 06 |
olle |
222 |
|
741 |
10 Oct 06 |
olle |
223 |
setup.stopFTPSetup(); |
741 |
10 Oct 06 |
olle |
224 |
} |
741 |
10 Oct 06 |
olle |
225 |
|
741 |
10 Oct 06 |
olle |
226 |
/** |
1652 |
22 May 07 |
gregory |
* This is the same as <CODE>startFTPLocalSetup()</CODE>! <BR> |
1652 |
22 May 07 |
gregory |
* Despite the name, this does not turn off the Xerver FTP Setup. <BR> |
1652 |
22 May 07 |
gregory |
* Your local IP is always allowed to change settings in setup. |
1652 |
22 May 07 |
gregory |
230 |
*/ |
1652 |
22 May 07 |
gregory |
231 |
public static void stopFTPSetup() { |
1652 |
22 May 07 |
gregory |
232 |
if (setup == null) { |
1652 |
22 May 07 |
gregory |
233 |
setup = new FTPSetup(); |
741 |
10 Oct 06 |
olle |
234 |
setup.start(); |
741 |
10 Oct 06 |
olle |
235 |
} |
741 |
10 Oct 06 |
olle |
236 |
|
741 |
10 Oct 06 |
olle |
237 |
setup.stopFTPSetup(); |
741 |
10 Oct 06 |
olle |
238 |
} |
741 |
10 Oct 06 |
olle |
239 |
|
741 |
10 Oct 06 |
olle |
240 |
/** |
1652 |
22 May 07 |
gregory |
* Get the version of Xerver Free FTP Server. |
1652 |
22 May 07 |
gregory |
242 |
*/ |
1652 |
22 May 07 |
gregory |
243 |
public static String getVersionString() { |
741 |
10 Oct 06 |
olle |
244 |
return s_FTPversion; |
741 |
10 Oct 06 |
olle |
245 |
} |
741 |
10 Oct 06 |
olle |
246 |
|
741 |
10 Oct 06 |
olle |
247 |
/** |
1652 |
22 May 07 |
gregory |
* Get the version of Xerver Free FTP Server. |
1652 |
22 May 07 |
gregory |
249 |
*/ |
1652 |
22 May 07 |
gregory |
250 |
public static double getVersion() { |
741 |
10 Oct 06 |
olle |
251 |
return d_FTPversion; |
741 |
10 Oct 06 |
olle |
252 |
} |
741 |
10 Oct 06 |
olle |
253 |
|
741 |
10 Oct 06 |
olle |
254 |
/** |
1652 |
22 May 07 |
gregory |
* Get your outer IP (the IP that is shown to computers outside your |
1652 |
22 May 07 |
gregory |
* network). |
1652 |
22 May 07 |
gregory |
257 |
*/ |
1652 |
22 May 07 |
gregory |
258 |
public static String getIP() { |
1652 |
22 May 07 |
gregory |
259 |
if (s_serverIP == null) { |
1652 |
22 May 07 |
gregory |
260 |
s_serverIP = HostInfo.getIPorLocalhost(); |
741 |
10 Oct 06 |
olle |
261 |
} |
741 |
10 Oct 06 |
olle |
262 |
|
741 |
10 Oct 06 |
olle |
263 |
return s_serverIP; |
741 |
10 Oct 06 |
olle |
264 |
} |
741 |
10 Oct 06 |
olle |
265 |
|
741 |
10 Oct 06 |
olle |
266 |
/** |
1652 |
22 May 07 |
gregory |
* Get the port the server is listening for. Clients shall connect to this |
1652 |
22 May 07 |
gregory |
* port. |
1652 |
22 May 07 |
gregory |
269 |
*/ |
1652 |
22 May 07 |
gregory |
270 |
public static int getPort() { |
1652 |
22 May 07 |
gregory |
271 |
if (server == null) |
741 |
10 Oct 06 |
olle |
272 |
return -1; |
741 |
10 Oct 06 |
olle |
273 |
else |
741 |
10 Oct 06 |
olle |
274 |
return server.getPort(); |
741 |
10 Oct 06 |
olle |
275 |
} |
741 |
10 Oct 06 |
olle |
276 |
|
741 |
10 Oct 06 |
olle |
277 |
/** |
1652 |
22 May 07 |
gregory |
* Get the port the server setup is listening to. Your browser shall connect |
1652 |
22 May 07 |
gregory |
* to http://localhost:PortNumber/ when you want change settings. |
1652 |
22 May 07 |
gregory |
280 |
*/ |
1652 |
22 May 07 |
gregory |
281 |
public static int getSetupPort() { |
741 |
10 Oct 06 |
olle |
282 |
return FTPSetup.getPort(); |
741 |
10 Oct 06 |
olle |
283 |
} |
741 |
10 Oct 06 |
olle |
284 |
|
741 |
10 Oct 06 |
olle |
285 |
/** |
1652 |
22 May 07 |
gregory |
* Returns true iff the FTP Server port is already in use. |
1652 |
22 May 07 |
gregory |
287 |
*/ |
1652 |
22 May 07 |
gregory |
288 |
public static boolean isPortInUseServer() { |
741 |
10 Oct 06 |
olle |
289 |
return server.isPortInUse(); |
741 |
10 Oct 06 |
olle |
290 |
} |
741 |
10 Oct 06 |
olle |
291 |
|
741 |
10 Oct 06 |
olle |
292 |
/** |
1652 |
22 May 07 |
gregory |
* Returns true iff we have a port error for the FTP Server (for example if |
1652 |
22 May 07 |
gregory |
* you try to run the server on port 999999). |
1652 |
22 May 07 |
gregory |
295 |
*/ |
1652 |
22 May 07 |
gregory |
296 |
public static boolean getPortErrorServer() { |
741 |
10 Oct 06 |
olle |
297 |
return server.getPortError(); |
741 |
10 Oct 06 |
olle |
298 |
} |
741 |
10 Oct 06 |
olle |
299 |
|
741 |
10 Oct 06 |
olle |
300 |
/** |
1652 |
22 May 07 |
gregory |
* Returns true iff the FTP Setup Server port is already in use. |
1652 |
22 May 07 |
gregory |
302 |
*/ |
1652 |
22 May 07 |
gregory |
303 |
public static boolean isPortInUseSetup() { |
741 |
10 Oct 06 |
olle |
304 |
return setup.isPortInUse(); |
741 |
10 Oct 06 |
olle |
305 |
} |
741 |
10 Oct 06 |
olle |
306 |
|
741 |
10 Oct 06 |
olle |
307 |
/** |
1652 |
22 May 07 |
gregory |
* Returns true iff we have a port error for the FTP Setup Server (for |
1652 |
22 May 07 |
gregory |
* example if you try to run the setup server on port 999999). |
1652 |
22 May 07 |
gregory |
310 |
*/ |
1652 |
22 May 07 |
gregory |
311 |
public static boolean getPortErrorSetup() { |
741 |
10 Oct 06 |
olle |
312 |
return setup.getPortError(); |
741 |
10 Oct 06 |
olle |
313 |
} |
741 |
10 Oct 06 |
olle |
314 |
} |