Introduced class utils to collect general reusable functions

pull/87/head
Thomas Joußen 2018-07-09 15:42:55 +02:00
parent 844e7f2999
commit 6effca3389
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package io.openvidu.server.core;
import org.apache.commons.lang3.RandomStringUtils;
public class Utils {
/**
* Generate a random alpha numeric key chain
* @return
*/
public String generateRandomChain() {
return RandomStringUtils.randomAlphanumeric(16).toLowerCase();
}
/**
* Check that the metadata only has a max length of 10000 chars.
*
* @param metadata
* @return
*/
public boolean isMetadataFormatCorrect(String metadata) {
return (metadata.length() <= 10000);
}
}