List of usage examples for org.apache.commons.lang RandomStringUtils randomAlphanumeric
public static String randomAlphanumeric(int count)
Creates a random string whose length is the number of characters specified.
Characters will be chosen from the set of alpha-numeric characters.
From source file:edu.harvard.iq.dataverse.PasswordEncryption.java
public static String generateRandomPassword() { return RandomStringUtils.randomAlphanumeric(8); }
From source file:net.sf.immc.util.security.NonceUtils.java
/** * java.util.Random(),???./* w w w . j av a 2s. c o m*/ * * @param length */ public static String randomString(int length) { return RandomStringUtils.randomAlphanumeric(length); }
From source file:net.dovemq.transport.link.LinkTestUtils.java
public static CAMQPMessage createMessage(Random randomGenerator) { String deliveryTag = UUID.randomUUID().toString(); int sectionSize = 256 * (randomGenerator.nextInt(10) + 1); String str = RandomStringUtils.randomAlphanumeric(sectionSize); CAMQPMessagePayload payload = new CAMQPMessagePayload(str.getBytes()); return new CAMQPMessage(deliveryTag, payload); }
From source file:gov.nih.nci.cabig.caaers2adeers.exchnage.HeaderGeneratorProcessor.java
public static String makeCorrelationId() { return String.valueOf(System.currentTimeMillis()) + RandomStringUtils.randomAlphanumeric(5); }
From source file:guru.bubl.module.model.forgot_password.UserForgotPasswordToken.java
private static String generateToken() { return RandomStringUtils.randomAlphanumeric(TOKEN_NUMBER_OF_CHARS); }
From source file:eu.vital.vitalcep.publisher.MQTT_connector_subscriper.java
public MQTT_connector_subscriper(String queueName, MessageProcessor_publisher MsgProcc) { if (connector == null) { this.queueName = queueName; clientName = "publisher_" + RandomStringUtils.randomAlphanumeric(4); MsgQueue oQueue = new MsgQueue(MsgProcc); connector = new MqttConnector(clientName, oQueue, "", queueName, 2, false); }//from ww w . j a v a 2s . c o m }
From source file:info.hieule.framework.laravel.utils.LaravelSecurityString.java
public static void updateSecurityString(FileObject configFile) throws IOException { List<String> lines = configFile.asLines(); String newKey = RandomStringUtils.randomAlphanumeric(32); OutputStream outputStream = configFile.getOutputStream(); PrintWriter pw = new PrintWriter(new OutputStreamWriter(outputStream, "UTF-8"), true); // NOI18N try {/*from w ww .j a v a 2s .c om*/ for (String line : lines) { if (line.contains(_SECURITY_STRING_LINE)) { line = String.format(_SECURITY_STRING_FORMAT, newKey); } pw.println(line); } } finally { outputStream.close(); pw.close(); } }
From source file:edu.sampleu.admin.GroupAftBase.java
protected void createNewEnterDetails() throws InterruptedException { waitAndTypeByName("document.documentHeader.documentDescription", RandomStringUtils.randomAlphanumeric(9)); selectByName("document.groupNamespace", "KR-BUS - Service Bus"); waitAndTypeByName("document.groupName", RandomStringUtils.randomAlphanumeric(9)); }
From source file:net.acesinc.util.test.service1.web.DontCacheController.java
@RequestMapping(value = { "/dontcache" }, method = RequestMethod.GET) public @ResponseBody String getPage(ModelMap model, Principal p) { model.addAttribute("pageName", "dontcache"); return RandomStringUtils.randomAlphanumeric(15); }
From source file:net.dovemq.transport.link.LinkTestUtils.java
public static CAMQPMessagePayload createMessagePayload(Random randomGenerator) { int sectionSize = 256 * (randomGenerator.nextInt(10) + 1); String str = RandomStringUtils.randomAlphanumeric(sectionSize); return new CAMQPMessagePayload(str.getBytes()); }