1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.webphotos;
17
18 import java.io.File;
19 import java.io.PrintWriter;
20 import java.net.InetAddress;
21 import net.sf.webphotos.gui.FrameWebFotos;
22 import net.sf.webphotos.util.Util;
23 import org.apache.derby.drda.NetworkServerControl;
24 import org.apache.log4j.Logger;
25
26
27
28
29
30 public class WebPhotos {
31
32 private static Logger log = Logger.getLogger(WebPhotos.class);
33
34
35
36
37
38
39
40
41
42 public static void main(String args[]) {
43
44 try {
45
46
47 File cacheftp = new File("CacheFTP.txt");
48 if (cacheftp.isFile()) {
49 cacheftp.delete();
50 }
51
52 Util.loadSocksProxy();
53 final String derbyDrdaHost = Util.getConfig().getString("derby.drda.host");
54 final int derbyDrdaPortNumber = Util.getConfig().getInt("derby.drda.portNumber");
55 final boolean derbyDrdaStartNetworkServer = Util.getConfig().getBoolean("derby.drda.startNetworkServer");
56
57
58
59
60 if (derbyDrdaStartNetworkServer) {
61 NetworkServerControl server = new NetworkServerControl(InetAddress.getByName(derbyDrdaHost), derbyDrdaPortNumber);
62 server.start(new PrintWriter(Util.out));
63 server.setMaxThreads(100);
64 }
65
66 BancoImagem.loadUIManager();
67 BancoImagem.loadDBDriver();
68
69
70 BancoImagem.login();
71
72
73 java.awt.EventQueue.invokeLater(new Runnable() {
74 @Override
75 public void run() {
76 FrameWebFotos.getInstance().setVisible(true);
77 }
78 });
79
80 } catch (Exception e) {
81 log.error("Não foi possível iniciar o WebPhotos", e);
82 }
83
84 }
85 }