Package com.itextpdf.testutils
Class CompareToolUtil
- java.lang.Object
-
- com.itextpdf.testutils.CompareToolUtil
-
public class CompareToolUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringSPLIT_REGEX
-
Constructor Summary
Constructors Constructor Description CompareToolUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbuildPath(java.lang.String path, java.lang.String[] fragments)static voidcopy(java.lang.String inputFile, java.lang.String outputFile)Creates a copy of a file.static java.lang.StringcreateTempCopy(java.lang.String file, java.lang.String tempFilePrefix, java.lang.String tempFilePostfix)Creates a temporary copy of a file.static java.lang.StringcreateTempDirectory(java.lang.String tempFilePrefix)Creates a temporary directory.static java.util.List<java.lang.String>prepareProcessArguments(java.lang.String exec, java.lang.String params)static booleanremoveFiles(java.lang.String[] paths)Removes all of the passed files.static java.lang.ProcessrunProcess(java.lang.String execPath, java.lang.String params)static java.util.List<java.lang.String>splitIntoProcessArguments(java.lang.String line)
-
-
-
Field Detail
-
SPLIT_REGEX
private static final java.lang.String SPLIT_REGEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTempCopy
public static java.lang.String createTempCopy(java.lang.String file, java.lang.String tempFilePrefix, java.lang.String tempFilePostfix) throws java.io.IOExceptionCreates a temporary copy of a file.- Parameters:
file- the path to the file to be copiedtempFilePrefix- the prefix of the copied file's nametempFilePostfix- the postfix of the copied file's name- Returns:
- the path to the copied file
- Throws:
java.io.IOException
-
copy
public static void copy(java.lang.String inputFile, java.lang.String outputFile) throws java.io.IOExceptionCreates a copy of a file.- Parameters:
inputFile- the path to the file to be copiedoutputFile- the path, to which the passed file should be copied- Throws:
java.io.IOException
-
createTempDirectory
public static java.lang.String createTempDirectory(java.lang.String tempFilePrefix) throws java.io.IOExceptionCreates a temporary directory.- Parameters:
tempFilePrefix- the prefix of the temporary directory's name- Returns:
- the path to the temporary directory
- Throws:
java.io.IOException
-
removeFiles
public static boolean removeFiles(java.lang.String[] paths)
Removes all of the passed files.- Parameters:
paths- paths to files, which should be removed- Returns:
- true if all the files have been successfully removed, false otherwise
-
runProcess
public static java.lang.Process runProcess(java.lang.String execPath, java.lang.String params) throws java.io.IOException, java.lang.InterruptedException- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
prepareProcessArguments
public static java.util.List<java.lang.String> prepareProcessArguments(java.lang.String exec, java.lang.String params)
-
splitIntoProcessArguments
public static java.util.List<java.lang.String> splitIntoProcessArguments(java.lang.String line)
-
buildPath
public static java.lang.String buildPath(java.lang.String path, java.lang.String[] fragments)
-
-