public final class Util
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Util.ExceptionRunnable |
static interface |
Util.ReturnRunnable<R> |
Modifier and Type | Method and Description |
---|---|
static void |
copyDirectory(java.io.File from,
java.io.File to)
Copy a Directory
|
static void |
copyFromJar(java.lang.ClassLoader loader,
java.lang.String resource,
java.lang.String destination)
Copy from the Class Loader
|
static void |
deleteDirectory(java.io.File folder)
Delete Directory
|
static <K,V> java.util.List<K> |
getBackwards(java.util.Map<K,V> map,
V value)
Get keys by value from map
|
static <V> V |
getNew(java.util.Collection<? extends V> existing,
Util.ReturnRunnable<V> generator)
Gets a new Variable that doesn't match the existing Variables
|
static boolean |
isException(Util.ExceptionRunnable runnable)
Determines if an Exception will occur
|
static boolean |
isNull(java.lang.Object... values)
Checks values to make sure they're not null
|
static int |
random(int min,
int max)
Get a Random Integer
|
static java.lang.String |
readAll(java.io.Reader rd)
Read Everything from Reader
|
static java.lang.String |
unescapeJavaString(java.lang.String str)
Parse escapes in a Java String
|
static void |
unzip(java.io.InputStream zip,
java.io.File dir) |
static void |
zip(java.io.File file,
java.io.OutputStream zip) |
public static boolean isNull(java.lang.Object... values)
values
- Values to checkpublic static <K,V> java.util.List<K> getBackwards(java.util.Map<K,V> map, V value)
K
- KeyV
- Valuemap
- Map to searchvalue
- Value to search forpublic static <V> V getNew(java.util.Collection<? extends V> existing, Util.ReturnRunnable<V> generator)
V
- Variable Typeexisting
- Existing Variablesgenerator
- Variable Generatorpublic static java.lang.String readAll(java.io.Reader rd) throws java.io.IOException
rd
- Readerjava.io.IOException
public static void copyFromJar(java.lang.ClassLoader loader, java.lang.String resource, java.lang.String destination)
loader
- ClassLoaderresource
- Location Fromdestination
- Location Topublic static boolean isException(Util.ExceptionRunnable runnable)
runnable
- Runnablepublic static void deleteDirectory(java.io.File folder)
folder
- Locationpublic static void copyDirectory(java.io.File from, java.io.File to)
from
- Sourceto
- Destinationpublic static void zip(java.io.File file, java.io.OutputStream zip)
public static void unzip(java.io.InputStream zip, java.io.File dir)
public static int random(int min, int max)
min
- Minimum Valuemax
- Maximum Valuepublic static java.lang.String unescapeJavaString(java.lang.String str)
str
- String