예제 #1
0
 /** set the file */
 public void setFile(String filename) {
   fds = new FileDataSource(filename);
   System.out.println("DCHTest2: FileDataSource created");
   if (!fds.getContentType().equals("text/plain")) {
     System.out.println("Type must be text/plain");
     System.exit(1);
   }
 }
예제 #2
0
  /** set the mailcap file in the CMD Map */
  public void setMailcap(String mailcap) {

    try {
      cmdMap = new MailcapCommandMap(mailcap);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
    }
  }
예제 #3
0
  /** main function */
  public static void main(String args[]) {
    DCHTest2 test = new DCHTest2();

    if (args.length < 2) {
      System.out.println("usage: DCHTest2 file.txt mailcap");
      System.exit(1);
    }

    // first let's get a DataSource

    test.setFile(args[0]);

    test.setMailcap(args[1]);
    test.doit();
  }
예제 #4
0
 public static void quit(
     int
         exitCode) { // redirect to System.exit() as to reduce warnings by static code analysis
                     // tools
   System.exit(exitCode);
 }
 private void jMenuItemQuitActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jMenuItemQuitActionPerformed
   this.shutDown();
   System.exit(0);
 } // GEN-LAST:event_jMenuItemQuitActionPerformed