String className = args[0]; File outputDir = new File(args[1]); String iterationsString = args[2]; int iterations = Integer.parseInt(iterationsString);  System.out.println("args : " + "image captcha engine class='" + className + "'" + ", output dir='" + outputDir + "'" + ",iterations='" + iterationsString + "'");  clearOutputDirectory(outputDir);  ImageCaptchaEngine pixCapchaEngine = null; if (className.equals("all")) { ImageCaptchaEngine[] engines = { new BasicListGimpyEngine(), new BaffleListGimpyEngine(), new DefaultGimpyEngine(), new DeformedBaffleListGimpyEngine(), new DoubleRandomListGimpyEngine(), new SimpleListImageCaptchaEngine(), new SimpleFishEyeEngine() }; for (int i = 0; i < engines.length; i++) { pixCapchaEngine = engines[i]; System.out.println("Beginning generation with " + pixCapchaEngine.getClass().getName()); try { generate(iterations, pixCapchaEngine, outputDir); } catch (Exception e) { System.out.println("Errors with class " + pixCapchaEngine.getClass().getName()); } } } else {  try { pixCapchaEngine = (ImageCaptchaEngine) Class.forName(className).newInstance(); } catch (Exception e) { System.out.println("Couldn't initialize '" + className + "', trying a likely package prefix"); String defaultClassPrefix = "com.octo.captcha.engine.image.gimpy."; try { pixCapchaEngine = (ImageCaptchaEngine) Class.forName(defaultClassPrefix + className).newInstance(); } catch (Exception e2) { System.out.println("Couldn't initialize '" + className + " -- specify a fully attributed name"); System.exit(1); } }  generate(iterations, pixCapchaEngine, outputDir); }
    public static void main(String[] args) throws Exception    {        if(args.length<2){            System.out.println("Usage : engineClassName outputDir iterations");            System.exit(1);        }          System.out.println("engine initialized");        int iterations = Integer.parseInt(args[2]);        String outfile = args[1];        System.out.println("args : image captcha engine class='" + args[0]                + "', " +                "output dir='" + args[1] + "'" +                ",iterations='" + args[2] + "'");        if(args[0].equals("all")){             generate(iterations, new BasicListGimpyEngine(), outfile);            generate(iterations, new BaffleListGimpyEngine(), outfile);            generate(iterations, new DefaultGimpyEngine(), outfile);            generate(iterations, new DeformedBaffleListGimpyEngine(), outfile);            generate(iterations, new DoubleRandomListGimpyEngine(), outfile);            generate(iterations, new SimpleListImageCaptchaEngine(), outfile);            generate(iterations, new SimpleFishEyeEngine(), outfile);        }else{        ImageCaptchaEngine  pixCapchaEngine= (ImageCaptchaEngine) Class.forName(                args[0])                .newInstance();        System.out.println("Beginning generation");            generate(iterations, pixCapchaEngine, outfile);        }        //ImageToFile encoder = new ImageToFile();        System.exit(0);    }