@@ -0,0 +1,2250 @@
+/*%0A * Copyright 2015, TeamDev Ltd. All rights reserved.%0A *%0A * Redistribution and use in source and/or binary forms, with or without%0A * modification, must retain the above copyright notice and the following%0A * disclaimer.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage lobby.common.util;%0A%0Aimport java.security.SecureRandom;%0A%0A/**%0A * The generator of random password strings.%0A *%0A * @author Alexander Litus%0A */%0A@SuppressWarnings(%7B%22UtilityClass%22, %22TypeMayBeWeakened%22%7D)%0Apublic class RandomPasswordGenerator %7B%0A%0A    // The characters allowed in passwords.%0A    private static final String ALLOWED_CHARS = %22AaBbCcDdEeFfGgHhiJjKkLMmNnPpQqRrSsTtUuVvWwXxYyZz123456789%22;%0A    private static final SecureRandom RANDOM = new SecureRandom();%0A%0A    private RandomPasswordGenerator() %7B%0A    %7D%0A%0A    /**%0A     * Generates a random password of the given length.%0A     *%0A     * @param stringLength the length of the password%0A     * @return a random password string%0A     */%0A    public static String generate(int stringLength) %7B%0A        final StringBuilder code = new StringBuilder(stringLength);%0A        for (int i = 0; i %3C stringLength; i++) %7B%0A            final char randomChar = getRandomChar(ALLOWED_CHARS);%0A            code.append(randomChar);%0A        %7D%0A        return code.toString();%0A    %7D%0A%0A    private static char getRandomChar(String allowedChars) %7B%0A        final int randomIndex = RANDOM.nextInt(allowedChars.length());%0A        final char result = allowedChars.charAt(randomIndex);%0A        return result;%0A    %7D%0A%7D%0A

Add random password generator (for conference/order access codes).