Merge pull request #180 from matzew/UtilCleanUp

some minor util class clean-up
This commit is contained in:
Bill Burke 2014-01-30 07:48:04 -08:00
commit 0e4e0cda3c
6 changed files with 26 additions and 6 deletions

View file

@ -20,11 +20,14 @@ import java.security.spec.X509EncodedKeySpec;
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class DerUtils {
public final class DerUtils {
static {
BouncyIntegration.init();
}
private DerUtils() {
}
public static PrivateKey decodePrivateKey(InputStream is)
throws Exception {

View file

@ -7,9 +7,13 @@ import java.util.regex.Pattern;
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class EnvUtil {
public final class EnvUtil {
private static final Pattern p = Pattern.compile("[$][{]([^}]+)[}]");
private EnvUtil() {
}
/**
* Replaces any ${} strings with their corresponding environent variable.
*

View file

@ -15,11 +15,14 @@ import java.security.cert.X509Certificate;
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class PemUtils {
public final class PemUtils {
static {
BouncyIntegration.init();
}
private PemUtils() {
}
public static X509Certificate decodeCertificate(InputStream is) throws Exception {
byte[] der = pemToDer(is);
ByteArrayInputStream bis = new ByteArrayInputStream(der);

View file

@ -9,7 +9,11 @@ import java.io.InputStreamReader;
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class StreamUtil {
public final class StreamUtil {
private StreamUtil() {
}
public static String readString(InputStream in) throws IOException
{
char[] buffer = new char[1024];

View file

@ -5,7 +5,10 @@ import java.util.concurrent.atomic.AtomicLong;
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class KeycloakSessionUtils {
public final class KeycloakSessionUtils {
private KeycloakSessionUtils() {
}
private static AtomicLong counter = new AtomicLong(1);

View file

@ -3,7 +3,10 @@ package org.keycloak.testsuite.performance;
/**
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
*/
public class PerfTestUtils {
public final class PerfTestUtils {
private PerfTestUtils() {
}
public static <T> T readSystemProperty(String propertyName, Class<T> expectedClass) {
String propAsString = System.getProperty(propertyName);