private static void generate(int iterations, ImageCaptchaEngine pixCapchaEngine, String outfile) throws IOException { int i; for (i = 0 ; i < iterations; i++) { ImageCaptcha captcha = pixCapchaEngine.getNextImageCaptcha(); System.out.println("Captcha " + i + " retrieved");
private static void generate(int iterations, ImageCaptchaEngine pixCaptchaEngine, File outputDir) throws IOException {
    private static void generate(int iterations, ImageCaptchaEngine pixCapchaEngine, String outfile) throws IOException {        int i;        for (i = 0 ; i < iterations; i++)        {            ImageCaptcha captcha = pixCapchaEngine.getNextImageCaptcha();            System.out.println("Captcha " + i + " retrieved");            File dirout = new File(                    outfile) ;            dirout.mkdirs();            File out = new File(dirout, File.separator +pixCapchaEngine.getClass().getName().substring(                            pixCapchaEngine.getClass().getPackage().getName().length()+1                    )+"Captcha_" + i + ".jpg");            ImageToFile.serialize(captcha.getImageChallenge(), out);            System.out.println("File i created " + out.toURL());        }    }