public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getClassImplVersion(Class clazz)
Gets the class implementation version from manifest.
|
static String |
getClassSpecVersion(Class clazz)
Gets the class specification version from manifest.
|
static String |
getManifestEntry(Class clazz,
String entryName)
Gets the manifest entry for the given class.
|
static String |
readFromUrl(String urlString)
Completely reads the content of the given URL as a string.
|
static void |
shutdownLog(org.apache.logging.log4j.Logger log,
InterruptedException ie)
Logs a shutdown message with the given exception.
|
static void |
sleep(long ms)
Do the best to sleep for the given time.
|
static boolean |
waitForHttp(String urlString,
int code)
Waits for the URL to become available.
|
public static void shutdownLog(org.apache.logging.log4j.Logger log,
InterruptedException ie)
log - A logger where to log the message to.ie - An exception causing the shutdown.public static boolean waitForHttp(String urlString, int code) throws Exception
urlString - The URL to check for.code - The expected HTTP response code.Exception - When it was not possible to check the URL.public static String readFromUrl(String urlString) throws IOException
urlString - The URL to read from.IOException - When it was not possible to read from the URL.public static String getManifestEntry(Class clazz, String entryName) throws IOException
clazz - The class I want to obtain entry for.entryName - The name of the entry to obtain.IOException - When it was not possible to get the manifest file.public static String getClassImplVersion(Class clazz)
clazz - The class I want to obtain version of.public static String getClassSpecVersion(Class clazz)
clazz - The class I want to obtain version of.public static void sleep(long ms)
InterruptedException.ms - The number of milliseconds to sleep for.Copyright © 2015–2016 px3. All rights reserved.