Initial import.
2 * StarOffice News Server
3 * see AUTHORS for the list of contributors
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 import java.net.BindException;
23 import java.sql.Driver;
24 import java.sql.DriverManager;
25 import java.util.Enumeration;
27 import com.so.news.storage.Database;
28 import com.so.news.storage.Purger;
31 * Startup class of the daemon.
32 * @author Christian Lins
36 /** Version information of the StarOffice News daemon */
37 public static final String VERSION = "StarOffice News Server 0.5alpha1";
40 * The main entrypoint.
44 public static void main(String args[]) throws Exception
46 System.out.println(VERSION);
48 // Command line arguments
49 boolean auxPort = false;
51 for(int n = 0; n < args.length; n++)
53 if(args[n].equals("--dumpjdbcdriver"))
55 System.out.println("Available JDBC drivers:");
56 Enumeration<Driver> drvs = DriverManager.getDrivers();
57 while(drvs.hasMoreElements())
58 System.out.println(drvs.nextElement());
61 else if(args[n].equals("--useaux"))
65 // Try to load the Database
72 ex.printStackTrace(Debug.getInstance().getStream());
73 System.err.println("Database initialization failed with " + ex.toString());
78 // Start the n3tpd garbage collector
81 // Start the listening daemon
84 new NNTPDaemon(false).start();
86 catch(BindException ex)
88 ex.printStackTrace(Debug.getInstance().getStream());
89 System.err.println("Could not bind to interface. Perhaps you need superuser rights?");
92 // Start auxilary listening port...
94 new NNTPDaemon(true).start();