Class CompareToolUtil


  • public class CompareToolUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String SPLIT_REGEX  
    • Constructor Summary

      Constructors 
      Constructor Description
      CompareToolUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String buildPath​(java.lang.String path, java.lang.String[] fragments)  
      static void copy​(java.lang.String inputFile, java.lang.String outputFile)
      Creates a copy of a file.
      static java.lang.String createTempCopy​(java.lang.String file, java.lang.String tempFilePrefix, java.lang.String tempFilePostfix)
      Creates a temporary copy of a file.
      static java.lang.String createTempDirectory​(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 boolean removeFiles​(java.lang.String[] paths)
      Removes all of the passed files.
      static java.lang.Process runProcess​(java.lang.String execPath, java.lang.String params)  
      static java.util.List<java.lang.String> splitIntoProcessArguments​(java.lang.String line)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompareToolUtil

        public CompareToolUtil()
    • Method Detail

      • createTempCopy

        public static java.lang.String createTempCopy​(java.lang.String file,
                                                      java.lang.String tempFilePrefix,
                                                      java.lang.String tempFilePostfix)
                                               throws java.io.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:
        java.io.IOException
      • copy

        public static void copy​(java.lang.String inputFile,
                                java.lang.String outputFile)
                         throws java.io.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:
        java.io.IOException
      • createTempDirectory

        public static java.lang.String createTempDirectory​(java.lang.String tempFilePrefix)
                                                    throws java.io.IOException
        Creates 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.IOException
        java.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)