Package com.google.code.kaptcha.util

Examples of com.google.code.kaptcha.util.Config


    public KaptchaProducerImpl(Map<String, String> configuration)
    {
        producer = new DefaultKaptcha();

        Config config = new Config(toProperties(configuration));

        producer.setConfig(config);

        height = config.getHeight();
        width = config.getWidth();
    }
View Full Code Here


    public KaptchaProducerImpl(Map<String, String> configuration)
    {
        producer = new DefaultKaptcha();

        Config config = new Config(toProperties(configuration));

        producer.setConfig(config);

        height = config.getHeight();
        width = config.getWidth();
    }
View Full Code Here

    public static CaptchaInfoBean generateCaptchaImage() throws Exception {
        String randomSecretKey = UUID.randomUUID().toString()//random string for the captcha.
        String imagePath = StratosConstants.CAPTCHA_IMAGES_PATH + RegistryConstants.PATH_SEPARATOR +
                           randomSecretKey + ".jpg";

        Config config = new Config(new Properties());
        Producer captchaProducer = config.getProducerImpl();
        String captchaText = captchaProducer.createText();

        BufferedImage image = captchaProducer.createImage(captchaText);

        File tempFile = File.createTempFile("temp-", ".jpg");
View Full Code Here

      @Override
      protected byte[] render()
      {
        DefaultKaptcha kaptcha = new DefaultKaptcha();
        Properties properties = new Properties();
        kaptcha.setConfig(new Config(properties));
        randomText = Captcha.randomString(6, 8);
        BufferedImage image = kaptcha.createImage(randomText);
        return toImageData(image);
      }
    };
View Full Code Here

      initKaptcha();
    }

    private void initKaptcha() {
      producer = new DefaultKaptcha();
      Config config = new Config(new Properties());
      producer.setConfig(config);
    }
View Full Code Here

        Properties props = new Properties();
        props.setProperty("kaptcha.textproducer.char.string", possibleSymbols);
        props.setProperty("kaptcha.textproducer.char.length", String.valueOf(length));
        props.setProperty("kaptcha.image.width", String.valueOf(width));
        props.setProperty("kaptcha.image.height", String.valueOf(height));
        Config conf = new Config(props);
        DefaultKaptcha captcha = new DefaultKaptcha();
        captcha.setConfig(conf);
        return captcha;
    }
View Full Code Here

TOP

Related Classes of com.google.code.kaptcha.util.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.