Package org.apache.tika.utils
Class ProcessUtils
java.lang.Object
org.apache.tika.utils.ProcessUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
escapeCommandLine
(String arg) This should correctly put double-quotes around an argument if ProcessBuilder doesn't seem to work (as it doesn't on paths with spaces on Windows)static FileProcessResult
execute
(ProcessBuilder pb, long timeoutMillis, int maxStdoutBuffer, int maxStdErrBuffer) This writes stdout and stderr to the FileProcessResult.static FileProcessResult
execute
(ProcessBuilder pb, long timeoutMillis, Path stdoutRedirect, int maxStdErrBuffer) This redirects stdout to stdoutRedirect path.static String
-
Constructor Details
-
ProcessUtils
public ProcessUtils()
-
-
Method Details
-
escapeCommandLine
This should correctly put double-quotes around an argument if ProcessBuilder doesn't seem to work (as it doesn't on paths with spaces on Windows)- Parameters:
arg
-- Returns:
-
unescapeCommandLine
-
execute
public static FileProcessResult execute(ProcessBuilder pb, long timeoutMillis, int maxStdoutBuffer, int maxStdErrBuffer) throws IOException This writes stdout and stderr to the FileProcessResult.- Parameters:
pb
-timeoutMillis
-maxStdoutBuffer
-maxStdErrBuffer
-- Returns:
- Throws:
IOException
-
execute
public static FileProcessResult execute(ProcessBuilder pb, long timeoutMillis, Path stdoutRedirect, int maxStdErrBuffer) throws IOException This redirects stdout to stdoutRedirect path.- Parameters:
pb
-timeoutMillis
-stdoutRedirect
-maxStdErrBuffer
-- Returns:
- Throws:
IOException
-