# Util (SubServers.Bungee)

net.ME1312.SubServers.Bungee.Library

## Class Util

- java.lang.Object
- - net.ME1312.SubServers.Bungee.Library.Util

    public final class Util
    extends java.lang.Object

SubServers Utility Class

### Nested Class Summary

Nested Classes
`static interface` `Util.ExceptionRunnable`
`static interface` `Util.ReturnRunnable<R>`

### Method Summary

All Methods Static Methods Concrete Methods
`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)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### isNull

    public static boolean isNull(java.lang.Object... values)

Checks values to make sure they're not null

Parameters:
  `values` - Values to check
Returns:
  If any are null

#### getBackwards

    public static <K,V> java.util.List<K> getBackwards(java.util.Map<K,V> map,
                                                       V value)

Get keys by value from map

Type Parameters:
  `K` - Key
  `V` - Value
Parameters:
  `map` - Map to search
  `value` - Value to search for
Returns:
  Search results

#### getNew

    public 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

Type Parameters:
  `V` - Variable Type
Parameters:
  `existing` - Existing Variables
  `generator` - Variable Generator
Returns:
  Variable

#### readAll

    public static java.lang.String readAll(java.io.Reader rd)
                                    throws java.io.IOException

Read Everything from Reader

Parameters:
  `rd` - Reader
Returns:
  Reader Contents
Throws:
  `java.io.IOException`

#### copyFromJar

    public static void copyFromJar(java.lang.ClassLoader loader,
                                   java.lang.String resource,
                                   java.lang.String destination)

Copy from the Class Loader

Parameters:
  `loader` - ClassLoader
  `resource` - Location From
  `destination` - Location To

#### isException

    public static boolean isException(Util.ExceptionRunnable runnable)

Determines if an Exception will occur

Parameters:
  `runnable` - Runnable
Returns:
  If an Exception occured

#### deleteDirectory

    public static void deleteDirectory(java.io.File folder)

Delete Directory

Parameters:
  `folder` - Location

#### copyDirectory

    public static void copyDirectory(java.io.File from,
                                     java.io.File to)

Copy a Directory

Parameters:
  `from` - Source
  `to` - Destination

#### zip

    public static void zip(java.io.File file,
                           java.io.OutputStream zip)

#### unzip

    public static void unzip(java.io.InputStream zip,
                             java.io.File dir)

#### random

    public static int random(int min,
                             int max)

Get a Random Integer

Parameters:
  `min` - Minimum Value
  `max` - Maximum Value
Returns:
  Random Integer

#### unescapeJavaString

    public static java.lang.String unescapeJavaString(java.lang.String str)

Parse escapes in a Java String

Parameters:
  `str` - String
Returns:
  Unescaped String