
public class Validate extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
ADB_PORT_MAX
Maximal number of adb port.
|
static long |
ADB_PORT_MIN
Minimal number of adb port.
|
static long |
CONSOLE_PORT_MAX
Maximal number of console port.
|
static long |
CONSOLE_PORT_MIN
Minimal number of console port.
|
| Constructor and Description |
|---|
Validate() |
| Modifier and Type | Method and Description |
|---|---|
static void |
isAdbPortValid(String adbPort)
Checks if adb port is in valid range.
|
static void |
isConsolePortValid(String consolePort)
Checks if console port is in valid range.
|
static boolean |
isPortValid(int port)
Checks if port is in range 0 - 65535
|
static boolean |
isPortValid(String port)
Checks if port is in range 0 - 65535
|
static boolean |
isReadable(File file,
String message)
Checks that the specified
file represents a readable file. |
static boolean |
isReadable(String path,
String message)
Checks that the specified String is not null or empty and represents a readable file, throws exception if it is empty or
null and does not represent a path to a file.
|
static void |
isReadableDirectory(File file,
String message)
Checks that the specified
file represents a readable directory. |
static void |
isReadableDirectory(String path,
String message)
Checks that the specified String is not null or empty and represents a readable directory, throws exception if it is
empty or null and does not represent a path to a directory.
|
static void |
isWritable(File file,
String message)
Checks that the specified File is not null or empty and represents a writeable file, throws exception if it is empty or
null and does not represent a path to a file.
|
static void |
notAllNullsOrEmpty(String[] strings,
String message)
Checks that at least one of specified String is not empty
|
static void |
notNull(Object object,
String message)
Checks if some object is null or not.
|
static void |
notNullOrEmpty(String string,
String message)
Checks that the specified String is not null or empty, throws exception if it is.
|
static void |
notNulls(Object[] objects,
String message)
Checks that all specified objects are not null objects.
|
static void |
sdCardFileName(String fileName,
String message)
Checks if file name of the SD card is valid which means it has to have suffix of ".img".
|
static void |
sdSize(String sdSize,
String message)
Checks if user set size of SD card in the proper format.
|
public static final long CONSOLE_PORT_MIN
public static final long CONSOLE_PORT_MAX
public static final long ADB_PORT_MIN
public static final long ADB_PORT_MAX
public static void notNull(Object object, String message) throws IllegalStateException, IllegalArgumentException
object - object to check against nullitymessage - the exception messageIllegalStateException - if object is nullIllegalArgumentException - when message object is nullpublic static void notNulls(Object[] objects, String message) throws IllegalStateException
objects - objects to check against nullitymessage - exception messageIllegalArgumentException - throws if at leas one object is nullIllegalStateExceptionpublic static void notNullOrEmpty(String string, String message) throws IllegalStateException
string - The object to checkmessage - The exception messageIllegalArgumentException - Thrown if string is nullIllegalStateExceptionpublic static void notAllNullsOrEmpty(String[] strings, String message) throws IllegalStateException
strings - The array of strings to be checkedmessage - The exception messageAndroidConfigurationException - Throws if all strings are null or emptyIllegalStateExceptionpublic static boolean isReadable(String path, String message) throws IllegalArgumentException
path - The path to checkmessage - The exception messageIllegalArgumentException - Thrown if path is empty, null or invalidpublic static void isReadableDirectory(String path, String message) throws IllegalArgumentException
path - The path to checkmessage - The exception messageIllegalArgumentException - Thrown if path is empty, null or invalidpublic static boolean isReadable(File file, String message) throws IllegalArgumentException
file represents a readable file.file - The file to checkmessage - The exception messageIllegalArgumentException - Thrown if file is null or invalidpublic static void isReadableDirectory(File file, String message) throws IllegalArgumentException
file represents a readable directory.file - The path to checkmessage - The exception messageIllegalArgumentException - Thrown if file is null or invalidpublic static void sdSize(String sdSize, String message) throws AndroidContainerConfigurationException
mksdcard tool from the Android tools distribution.sdSize - size of sd cardmessage - The exception messageAndroidContainerConfigurationException - when sdSize is invalidpublic static void isConsolePortValid(String consolePort) throws AndroidContainerConfigurationException
consolePort - console port to check validity ofAndroidContainerConfigurationException - if console port is null or not a number or not validpublic static void isAdbPortValid(String adbPort) throws AndroidContainerConfigurationException
adbPort - adb port to check validity ofAndroidContainerConfigurationException - if adb port is null or not a number or not validpublic static boolean isPortValid(int port)
port - port number to check the validity ofpublic static boolean isPortValid(String port)
port - port number to check the validity ofNumberFormatException - when port is not a numberpublic static void sdCardFileName(String fileName, String message) throws AndroidContainerConfigurationException
fileName - name of the file to check validity ofmessage - exception messageAndroidContainerConfigurationException - if file name of SD card is not valid.public static void isWritable(File file, String message) throws IllegalArgumentException
file - The file to checkmessage - The exception messageIllegalArgumentException - Thrown if file is null or invalidCopyright © 2013 JBoss by Red Hat. All rights reserved.