some minor util class clean-up, to prevent instanciation of util classes

This commit is contained in:
Matthias Wessendorf
2014-01-28 14:30:22 +01:00
parent 41d631d20e
commit 2efcb95fd6
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);