Exemple #1
0
 public void sendUpdate() throws Exception {
   Socket socket = new Socket(hcs.getAddress(), hcs.getPort());
   BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
   writer.write("<ppEngineUpdated>\n");
   writer.flush();
   Logger.log("Sent <ppEngineUpdated> to " + hcs.getLabel());
   writer.close();
   socket.close();
 }
Exemple #2
0
  public void connectFtp() throws Exception {
    ftp.setDefaultTimeout(1500);
    ftp.connect(hcs.getAddress());
    ftp.login(hcs.getUsername(), hcs.getPassword());
    int reply = ftp.getReplyCode();

    if (FTPReply.isPositiveCompletion(reply)) {
      System.out.println("HCS " + hcs.getLabel() + ": Connected successfully");
    } else {
      System.out.println("HCS " + hcs.getLabel() + ": Connection failed");
      ftp.disconnect();
    }
  }