/** 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); } }
/** 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); } }
/** 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(); }
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