Package org.apache.taglibs.random

Examples of org.apache.taglibs.random.RandomStrg


        // '*','@', '#', '$', '%', '^',
        //'+',

    public String generatePassword()
    {
        RandomStrg rs = new RandomStrg();
       
        //TODO put in a more secure random number provider
        //rs.setAlgorithm();   -- ideally call this for super security.  need rnd provider
       
        try
        {
            rs.generateRandomObject();
        } catch (JspException e)
        {
            // this would only get thrown if we tried a secure random and the provider
            // was not available.
            e.printStackTrace();
        }
        rs.setLength(new Integer(12));
        rs.setSingle(PASS_CHARS,PASS_CHARS.length);
        ArrayList upper = new ArrayList();
        ArrayList lower = new ArrayList();
        //upper.add(new Character('A'));
        //lower.add(new Character('B'));
        rs.setRanges(upper,lower);
        String retval = rs.getRandom();
       
        return retval;       
    }
View Full Code Here


        // '*','@', '#', '$', '%', '^',
        //'+',

    public String generatePassword()
    {
        RandomStrg rs = new RandomStrg();
       
        //TODO put in a more secure random number provider
        //rs.setAlgorithm();   -- ideally call this for super security.  need rnd provider
       
        try
        {
            rs.generateRandomObject();
        } catch (JspException e)
        {
            // this would only get thrown if we tried a secure random and the provider
            // was not available.
            e.printStackTrace();
        }
        rs.setLength(new Integer(12));
        rs.setSingle(PASS_CHARS,PASS_CHARS.length);
        ArrayList upper = new ArrayList();
        ArrayList lower = new ArrayList();
        //upper.add(new Character('A'));
        //lower.add(new Character('B'));
        rs.setRanges(upper,lower);
        String retval = rs.getRandom();
       
        return retval;       
    }
View Full Code Here

    protected Integer                     length             = new Integer(12);
    protected CredentialPasswordValidator validator;

    protected RandomStrg newRandomStrg()
    {
        RandomStrg rs = new RandomStrg();
        try
        {
            rs.generateRandomObject();
        }
        catch (Exception e)
        {
            // this would only get thrown if we tried a secure random and the provider
            // was not available.
View Full Code Here

     * @see org.apache.jetspeed.administration.PasswordGenerator#generatePassword()
     */
    public String generatePassword()
    {
        String retval = null;
        RandomStrg rs = newRandomStrg();
        initRandomStrg(rs);
        while (retval == null)
        {
            retval = rs.getRandom();
            if (validator != null)
            {
                try
                {
                    validator.validate(retval);
View Full Code Here

TOP

Related Classes of org.apache.taglibs.random.RandomStrg

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.