public class ReadyTools extends Object
Modifier and Type | Field and Description |
---|---|
static int |
COPY_BUFFER_SIZE |
static long |
READ_ALL |
Constructor and Description |
---|
ReadyTools() |
Modifier and Type | Method and Description |
---|---|
static void |
assertSimilar(String expected,
String real,
char wildcard)
Compares two string for similarity, allows wildcard.
|
static String |
convertToHtml(String str) |
static File |
createTemporaryDirectory() |
static void |
deleteDirectoryOnExit(File directory)
Deprecated.
|
static void |
deleteLeftoverDirectories() |
static void |
deleteOnExit(File fileToDelete) |
static String |
ensureDir(String outputDir) |
static String |
ensureDir(String dir,
String basedir) |
static String |
ensureFileDir(String file,
String basedir) |
static double |
getCpuLoad() |
static String |
getDir(String filePath) |
static String |
getEndpointFromUrl(URL baseUrl) |
static String |
getFileContent(String path) |
static String |
getFilename(String filePath) |
static long |
getFreeOSMemory() |
static long |
getFreeOSMemoryMb() |
static int |
getIntegerSystemProperty(String propertyName,
int defaultValue) |
static String |
getTitleProperty(String path) |
static long |
getTotalOSMemory() |
static long |
getTotalOSMemoryMb() |
static long |
getUsedMemory() |
static String |
getVmOptionValue(String vmOptionMarker) |
static long |
getXmx() |
static long |
getXmxMb() |
static byte[] |
gzipBinaryData(byte[] rawResponseData) |
static boolean |
isEmpty(String str) |
static boolean |
isGetRequestBodyAllowed() |
static boolean |
isLinux() |
static boolean |
isMac() |
static boolean |
isNullOrEmpty(String str) |
static boolean |
isSimilar(String expected,
String real,
char wildcard) |
static boolean |
isWindows() |
static boolean |
isX64Platform() |
static boolean |
isX86Platform() |
static String |
joinRelativeUrl(String baseUrl,
String url)
Joins a relative url to a base url..
|
static String |
normalizeFileSeparators(String input) |
static boolean |
openEmailClient(String subject,
String body) |
static void |
openFile(String filePath)
Deprecated.
Replaced by
openURL(String url) |
static void |
openURL(String url) |
static ByteArrayOutputStream |
readAll(InputStream instream,
long maxSize) |
static void |
readAndWrite(InputStream instream,
long maxSize,
OutputStream outstream) |
static String |
removePropertyExpansions(String definitionUrl,
String definition) |
static String |
replaceHost(String endpoint,
String host)
Replaces the host part of the specified endpoint with the specified host
|
static void |
sleep(long milliseconds) |
static String[] |
tokenizeArgs(String args) |
static byte[] |
unzipGzippedData(byte[] zippedData) |
static long |
writeAll(OutputStream out,
InputStream in) |
public static final int COPY_BUFFER_SIZE
public static final long READ_ALL
public static void assertSimilar(String expected, String real, char wildcard) throws junit.framework.ComparisonFailure
expected
- real
- wildcard
- junit.framework.ComparisonFailure
public static void deleteLeftoverDirectories()
public static boolean isSimilar(String expected, String real, char wildcard) throws junit.framework.ComparisonFailure
junit.framework.ComparisonFailure
@Deprecated public static void deleteDirectoryOnExit(File directory)
directory
- public static void deleteOnExit(File fileToDelete)
public static File createTemporaryDirectory() throws IOException
IOException
@Deprecated public static void openFile(String filePath)
openURL(String url)
public static void openURL(String url)
public static ByteArrayOutputStream readAll(InputStream instream, long maxSize) throws IOException
IOException
public static void readAndWrite(InputStream instream, long maxSize, OutputStream outstream) throws IOException
IOException
public static String joinRelativeUrl(String baseUrl, String url)
public static boolean isEmpty(String str)
public static long writeAll(OutputStream out, InputStream in) throws IOException
IOException
public static String replaceHost(String endpoint, String host)
endpoint
- the endpoint to modifyhost
- the host to setpublic static boolean isWindows()
public static boolean isMac()
public static boolean isLinux()
public static boolean isX86Platform()
public static boolean isX64Platform()
public static boolean isGetRequestBodyAllowed()
public static int getIntegerSystemProperty(String propertyName, int defaultValue)
public static boolean isNullOrEmpty(String str)
public static long getXmx()
public static long getXmxMb()
public static long getUsedMemory()
public static long getTotalOSMemory()
public static long getTotalOSMemoryMb()
public static long getFreeOSMemory()
public static long getFreeOSMemoryMb()
public static double getCpuLoad()
public static byte[] unzipGzippedData(byte[] zippedData) throws IOException
IOException
public static byte[] gzipBinaryData(byte[] rawResponseData) throws IOException
IOException
public static void sleep(long milliseconds)
Copyright © 2019. All rights reserved.