public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static void |
closeQuietly(Closeable closeable)
Closes specified closeable without throwing exceptions
|
static File |
createTmpDir(Class<?> clazz)
Creates temporary directory for given class
|
static String |
escapeQuotes(String str)
Escapes all quotes with "\" in specified string
|
static void |
sleep(long millis)
Thread#sleep call without checked exceptions
|
static LinkedHashMap<String,Object> |
toMap(Object[] dataArray)
Converts "key1, value1, key2, value2" array into
"key1->value, key2->value2" map
|
public static void sleep(long millis)
millis
- number of milliseconds to sleeppublic static String escapeQuotes(String str)
str
- input stringpublic static LinkedHashMap<String,Object> toMap(Object[] dataArray)
dataArray
- input array with even number of elementspublic static File createTmpDir(Class<?> clazz) throws IOException
clazz
- name of this class will be used in dir nameIOException
- creation errorpublic static void closeQuietly(Closeable closeable)
closeable
- closeable instance to closeCopyright © 2017. All rights reserved.