Пример #1
0
  private void startServer() {
    try {
      ServerCallback callback = new ServerCallback();
      server = new HttpServer();

      // server.setOutputDir(outputDirText.getText());

      server.startup(callback);
      logger.info("Server started ");

      final String DATE_TIME_FORMAT = "dd.MM.yyyy HH:mm:ss";
      final SimpleDateFormat stf = new SimpleDateFormat(DATE_TIME_FORMAT);

      serverStatus.setText("Server started at " + stf.format(new Date()));
    } catch (Exception err) {
      logger.error("Error " + err.getMessage(), err);
      serverStatus.setText("Error Server " + err.getMessage());
    }
  }
Пример #2
0
 @Override
 public void dispose() {
   if (server != null) server.shutdown();
   // TODO Auto-generated method stub
   super.dispose();
 }