public class SystemUtils
extends java.lang.Object
Constructor and Description |
---|
SystemUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
fileSeparator() |
static java.lang.String |
javaClassPath() |
static java.lang.String |
javaClassVersion() |
static java.lang.String |
javaHome() |
static java.lang.String |
javaLibraryPath() |
static java.lang.String |
javaTemporaryDirectory() |
static java.lang.String |
javaVendor() |
static java.lang.String |
javaVersion() |
static java.lang.String |
lineSeparator() |
static java.lang.String |
operatingSystemArchitecture() |
static java.lang.String |
operatingSystemName() |
static java.lang.String |
operatingSystemVersion() |
static java.lang.String |
pathSeparator() |
static java.lang.String |
replaceProperties(java.lang.String str,
java.util.regex.Pattern pattern,
java.util.Map values)
Match the received string against the given pattern, and replace each match by the value associated to the first group of the match (group(1)).
|
static java.lang.String |
replaceSystemProperties(java.lang.String str)
Replace system property values in the given String using the ${system.property} convention.
|
static java.lang.String |
userDirectory() |
static java.lang.String |
userHome() |
static java.lang.String |
userName() |
public static java.lang.String javaVersion()
System.getProperties()
public static java.lang.String javaVendor()
System.getProperties()
public static java.lang.String javaHome()
System.getProperties()
public static java.lang.String javaClassVersion()
System.getProperties()
public static java.lang.String javaClassPath()
System.getProperties()
public static java.lang.String javaTemporaryDirectory()
System.getProperties()
public static java.lang.String javaLibraryPath()
System.getProperties()
public static java.lang.String operatingSystemArchitecture()
System.getProperties()
public static java.lang.String operatingSystemName()
System.getProperties()
public static java.lang.String operatingSystemVersion()
System.getProperties()
public static java.lang.String fileSeparator()
System.getProperties()
public static java.lang.String pathSeparator()
System.getProperties()
public static java.lang.String lineSeparator()
System.getProperties()
public static java.lang.String userName()
System.getProperties()
public static java.lang.String userHome()
System.getProperties()
public static java.lang.String userDirectory()
System.getProperties()
public static java.lang.String replaceSystemProperties(java.lang.String str)
public static java.lang.String replaceProperties(java.lang.String str, java.util.regex.Pattern pattern, java.util.Map values)
There's one constraint on the regex pattern, it should capture at least one group (i.e. match.groupe(1) should not be null). The value of this group is used to retrieved the replacement value from the map. For instance: pattern = "\\$\\{([^\\}]+)\\}"
str
- pattern
- values
-