Class CompareToolUtil

java.lang.Object
com.itextpdf.testutils.CompareToolUtil

public class CompareToolUtil extends Object
  • Field Details

  • Constructor Details

    • CompareToolUtil

      public CompareToolUtil()
  • Method Details

    • 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 copied
      tempFilePrefix - the prefix of the copied file's name
      tempFilePostfix - 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 copied
      outputFile - 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:
      IOException
      InterruptedException
    • prepareProcessArguments

      public static List<String> prepareProcessArguments(String exec, String params)
    • splitIntoProcessArguments

      public static List<String> splitIntoProcessArguments(String line)
    • buildPath

      public static String buildPath(String path, String[] fragments)