KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ftpserver > FtpServer


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package ftpserver;
16
17 import org.quickserver.net.*;
18 import org.quickserver.net.server.*;
19
20 import java.io.*;
21 import java.util.*;
22 import java.util.logging.*;
23
24 public class FtpServer {
25     public static String JavaDoc version = "0.3";
26
27     public static void main(String JavaDoc args[]) {
28         QuickServer ftpServer = new QuickServer();
29         
30         String JavaDoc confFile = "conf"+File.separator+"FtpServer.xml";
31         Object JavaDoc config[] = new Object JavaDoc[] {confFile};
32         if(ftpServer.initService(config) == true) {
33             try {
34                 ftpServer.startServer();
35                 ftpServer.startQSAdminServer();
36             } catch(AppException e){
37                 System.out.println("Error in server : "+e);
38                 e.printStackTrace();
39             }
40         }
41     }
42
43     private static void usage() {
44         System.err.println(
45             "---------------------------\n"+
46             "QuickFTPServer v "+version+" Usage \n"+
47             "---------------------------\n"+
48             "ftpserver help\n"+
49             "\tDisplays this help screen.\n"+
50             "ftpserver [ftp_root_dir]\n"+
51             "\tDefault are \n"+
52             "\t Dir : User Home Dir");
53     }
54 }
55
Free Books   Free Magazines  
Popular Tags