@PublicAPI public class SelectionUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CONTAINS
Pattern matching operator
|
static int |
EQUAL
Equal than operator
|
static int |
GREATER_THAN
Greater than operator
|
static int |
LESS_THAN
Less than operator
|
Constructor and Description |
---|
SelectionUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkCudaWin()
Check if CUDA is set-up (for Windows System only)
|
static boolean |
checkExec(String fileName)
Check if a file exist in folders contains in PATH environment variable
|
static boolean |
checkFileExist(String filePath)
Check if the given file path exist or not.
|
static boolean |
checkFreeMemory(long requiredMemory)
Check if there is enough free memory.
|
static boolean |
checkFreeSpaceDiskAvailable(Long space,
String path)
Check if free space (for a specify path) is greater than space
|
static boolean |
checkFreeSpaceDiskAvailableForTmpDir(Long space)
Check if default free space (tmpdir) is greater than parameter
|
static boolean |
checkHostName(String hostName)
Check if the host name is the given one.
|
static boolean |
checkIp(String network)
Check if the host matches the given IP address.
The IP can be given as x.x.x.x or using the token * to match a network for example. |
static boolean |
checkJavaProperty(String propertyName,
String propertyValue)
Check a Java Property
|
static boolean |
checkOSArch(String osArch)
Check the OS Architecture
|
static boolean |
checkOSName(String exp)
Check the OS Name (case-insensitive)
|
static boolean |
checkOSVersion(String osVersion)
Check the OS Version
|
static boolean |
checkProperties(String configFilePath,
Conditions conditions)
Check all given conditions in the given configuration file path.
This method returns true if (and only if) every conditions match the given file. |
static boolean |
checkProperty(String configFilePath,
Condition condition)
Check the condition in the given configuration file.
|
static boolean |
checkWifi()
Check if a wireless network interface exist
|
public static final int LESS_THAN
public static final int GREATER_THAN
public static final int EQUAL
public static final int CONTAINS
public static boolean checkProperties(String configFilePath, Conditions conditions)
configFilePath
- configuration pathconditions
- the conditions object (which is a collection of condition objects )public static boolean checkProperty(String configFilePath, Condition condition)
configFilePath
- configuration file pathcondition
- the condition to testpublic static boolean checkHostName(String hostName)
hostName
- the host name to checkpublic static boolean checkIp(String network)
network
- the network to matchpublic static boolean checkFileExist(String filePath)
filePath
- the file path to checkpublic static boolean checkOSName(String exp)
exp
- the regular expression which is requiredpublic static boolean checkOSArch(String osArch)
osArch
- the require OS Architecturepublic static boolean checkOSVersion(String osVersion)
osVersion
- the required OS Versionpublic static boolean checkJavaProperty(String propertyName, String propertyValue)
propertyName
- the name of the property.propertyValue
- the excepted value.public static boolean checkCudaWin()
public static boolean checkFreeMemory(long requiredMemory)
requiredMemory
- the minimum amount of memory which is required (measured in byte)public static boolean checkExec(String fileName)
fileName
- the name of the file which is requiredpublic static boolean checkWifi()
public static boolean checkFreeSpaceDiskAvailable(Long space, String path)
space
- the minimum required spacepath
- the path which have the required spacepublic static boolean checkFreeSpaceDiskAvailableForTmpDir(Long space)
space
- the minimum required space