Package com.itextpdf.commons.utils
Class SystemUtil
java.lang.Object
com.itextpdf.commons.utils.SystemUtil
This file is a helper class for internal usage only. Be aware that its API and functionality may be changed in future.
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
static String
Gets either java property or environment variable with given name.static long
Should be used in relative constructs (for example to check how many milliseconds have passed).static int
static long
static StringBuilder
runProcessAndCollectErrors
(String execPath, String params) static int
runProcessAndGetExitCode
(String exec, String params) static int
runProcessAndGetExitCode
(String exec, String params, String workingDirPath) static String
runProcessAndGetOutput
(String command, String params) static ProcessInfo
runProcessAndGetProcessInfo
(String command, String params) static boolean
runProcessAndWait
(String exec, String params) static boolean
runProcessAndWait
(String exec, String params, String workingDirPath)
-
Method Details
-
getTimeBasedSeed
public static long getTimeBasedSeed() -
getTimeBasedIntSeed
public static int getTimeBasedIntSeed() -
getRelativeTimeMillis
public static long getRelativeTimeMillis()Should be used in relative constructs (for example to check how many milliseconds have passed).Shouldn't be used in the Date creation since the value returned by this method is different in С#. For getting current time consistently use
DateTimeUtil.getCurrentTimeDate()
.- Returns:
- relative time in milliseconds.
-
getFreeMemory
public static long getFreeMemory() -
getPropertyOrEnvironmentVariable
Gets either java property or environment variable with given name.- Parameters:
-
name
- the name of either java property or environment variable. - Returns:
- property or variable value or null if there is no such.
-
runProcessAndWait
public static boolean runProcessAndWait(String exec, String params) throws IOException, InterruptedException - Throws:
-
IOException
-
InterruptedException
-
runProcessAndWait
public static boolean runProcessAndWait(String exec, String params, String workingDirPath) throws IOException, InterruptedException - Throws:
-
IOException
-
InterruptedException
-
runProcessAndGetExitCode
public static int runProcessAndGetExitCode(String exec, String params) throws IOException, InterruptedException - Throws:
-
IOException
-
InterruptedException
-
runProcessAndGetExitCode
public static int runProcessAndGetExitCode(String exec, String params, String workingDirPath) throws IOException, InterruptedException - Throws:
-
IOException
-
InterruptedException
-
runProcessAndGetOutput
- Throws:
-
IOException
-
runProcessAndCollectErrors
public static StringBuilder runProcessAndCollectErrors(String execPath, String params) throws IOException - Throws:
-
IOException
-
runProcessAndGetProcessInfo
public static ProcessInfo runProcessAndGetProcessInfo(String command, String params) throws IOException, InterruptedException - Throws:
-
IOException
-
InterruptedException
-