1 19 package org.netbeans.modules.sendopts; 20 21 import java.io.File ; 22 import java.io.InputStream ; 23 import java.io.OutputStream ; 24 import java.io.PrintStream ; 25 import java.io.PrintWriter ; 26 import org.netbeans.api.sendopts.CommandException; 27 import org.netbeans.api.sendopts.CommandLine; 28 import org.openide.util.NbBundle; 29 30 34 final class HandlerImpl extends Object { 35 static int execute(String [] arr, InputStream is, OutputStream os, OutputStream err, File pwd) { 36 try { 37 CommandLine.getDefault().process( 38 arr, is, os, err, pwd 39 ); 40 for (int i = 0; i < arr.length; i++) { 41 arr[i] = null; 42 } 43 return 0; 44 } catch (CommandException ex) { 45 PrintStream ps = new PrintStream (err); 46 ps.println(ex.getLocalizedMessage()); 47 return ex.getExitCode(); 51 } 52 } 53 54 static void usage(PrintWriter w) { 55 w.print(NbBundle.getMessage(HandlerImpl.class, "MSG_OptionsHeader")); CommandLine.getDefault().usage(w); 57 w.println(); 58 } 59 } 60 | Popular Tags |