Package com.itextpdf.testutils
Class CompareToolUtil
- java.lang.Object
-
- com.itextpdf.testutils.CompareToolUtil
-
public class CompareToolUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description CompareToolUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbuildPath(String path, String[] fragments)static voidcopy(String inputFile, String outputFile)Creates a copy of a file.static StringcreateTempCopy(String file, String tempFilePrefix, String tempFilePostfix)Creates a temporary copy of a file.static StringcreateTempDirectory(String tempFilePrefix)Creates a temporary directory.static List<String>prepareProcessArguments(String exec, String params)static booleanremoveFiles(String[] paths)Removes all of the passed files.static ProcessrunProcess(String execPath, String params)static List<String>splitIntoProcessArguments(String line)
-
-
-
Method Detail
-
createTempCopy
public static String createTempCopy(String file, String tempFilePrefix, String tempFilePostfix) throws IOException
Creates 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:
IOException
-
copy
public static void copy(String inputFile, String outputFile) throws IOException
Creates 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:
IOException
-
createTempDirectory
public static String createTempDirectory(String tempFilePrefix) throws IOException
Creates a temporary directory.- Parameters:
tempFilePrefix- the prefix of the temporary directory's name- Returns:
- the path to the temporary directory
- Throws:
IOException
-
removeFiles
public static boolean removeFiles(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 Process runProcess(String execPath, String params) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
prepareProcessArguments
public static List<String> prepareProcessArguments(String exec, String params)
-
-