예제 #1
0
  /** Method overridden to close connection to the mail server. */
  @Override
  protected void jobStopped() {
    super.jobStopped();

    // Close the connection
    closeConnection();
  }
예제 #2
0
  /**
   * This method is called when this job starts, before the first call to {@link
   * #processFile(AbstractFile,Object) processFile()} is made. This method here does nothing but it
   * can be overriden by subclasses to perform some first-time initializations.
   */
  @Override
  protected void jobStarted() {
    super.jobStarted();

    // Open socket connection to the mail server, and say hello
    try {
      openConnection();
    } catch (IOException e) {
      showErrorDialog(Translator.get("email.server_unavailable", mailServer));
    }

    if (getState() == INTERRUPTED) return;

    // Send mail body
    try {
      sendBody();
    } catch (IOException e) {
      showErrorDialog(Translator.get("email.connection_closed"));
    }
  }