some minor util class clean-up, to prevent instanciation of util classes
This commit is contained in:
1 parent
41d631d20e
commit
2efcb95fd6
6 files changed
+26
-6
No files matched your search
@@ -20,11 +20,14 @@ import java.security.spec.X509EncodedKeySpec;
|
|||||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public class DerUtils {
|
public final class DerUtils {
|
||||||
static {
|
static {
|
||||||
BouncyIntegration.init();
|
BouncyIntegration.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DerUtils() {
|
||||||
|
}
|
||||||
|
|
||||||
public static PrivateKey decodePrivateKey(InputStream is)
|
public static PrivateKey decodePrivateKey(InputStream is)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,13 @@ import java.util.regex.Pattern;
|
|||||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public class EnvUtil {
|
public final class EnvUtil {
|
||||||
private static final Pattern p = Pattern.compile("[$][{]([^}]+)[}]");
|
private static final Pattern p = Pattern.compile("[$][{]([^}]+)[}]");
|
||||||
|
|
||||||
|
private EnvUtil() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replaces any ${} strings with their corresponding environent variable.
|
* Replaces any ${} strings with their corresponding environent variable.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ import java.security.cert.X509Certificate;
|
|||||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public class PemUtils {
|
public final class PemUtils {
|
||||||
static {
|
static {
|
||||||
BouncyIntegration.init();
|
BouncyIntegration.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PemUtils() {
|
||||||
|
}
|
||||||
|
|
||||||
public static X509Certificate decodeCertificate(InputStream is) throws Exception {
|
public static X509Certificate decodeCertificate(InputStream is) throws Exception {
|
||||||
byte[] der = pemToDer(is);
|
byte[] der = pemToDer(is);
|
||||||
ByteArrayInputStream bis = new ByteArrayInputStream(der);
|
ByteArrayInputStream bis = new ByteArrayInputStream(der);
|
||||||
|
|||||||
@@ -9,7 +9,11 @@ import java.io.InputStreamReader;
|
|||||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public class StreamUtil {
|
public final class StreamUtil {
|
||||||
|
|
||||||
|
private StreamUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
public static String readString(InputStream in) throws IOException
|
public static String readString(InputStream in) throws IOException
|
||||||
{
|
{
|
||||||
char[] buffer = new char[1024];
|
char[] buffer = new char[1024];
|
||||||
|
|||||||
@@ -5,7 +5,10 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||||||
/**
|
/**
|
||||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
* @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);
|
private static AtomicLong counter = new AtomicLong(1);
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -3,7 +3,10 @@ package org.keycloak.testsuite.performance;
|
|||||||
/**
|
/**
|
||||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
* @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) {
|
public static <T> T readSystemProperty(String propertyName, Class<T> expectedClass) {
|
||||||
String propAsString = System.getProperty(propertyName);
|
String propAsString = System.getProperty(propertyName);
|
||||||
|
|||||||
Reference in new issue
Block a user