Class OutputFileDigest


  • abstract class OutputFileDigest
    extends java.lang.Object
    The OutputFileDigest class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean check​(java.io.File file, java.lang.String toolName, java.lang.String compatibleVersion, java.util.List<java.lang.String> options, Context context)
      Check if the File already exists.
      private static void checkOptions​(java.io.File file, java.lang.String[] options, Context context)
      Read the options line from the file and compare to the options currently in use.
      private static void checkVersion​(java.io.File file, java.lang.String toolName, java.lang.String versionId, Context context)
      Output a warning if the file was created with an incompatible version of JavaCC.
      static java.lang.String getDigestLine​(java.security.DigestOutputStream digestStream)
      Creates the Digest Line.
      static java.security.DigestOutputStream getDigestStream​(java.io.OutputStream stream)
      Create an MD5 DigestOutputStream for the provided OutputStream.
      private static java.lang.String toHexString​(java.security.DigestOutputStream digestStream)  
      • Methods inherited from class java.lang.Object

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

      • MD5_LINE_PART_1q

        private static final java.lang.String MD5_LINE_PART_1q
        See Also:
        Constant Field Values
      • MD5_LINE_PART_2q

        private static final java.lang.String MD5_LINE_PART_2q
        See Also:
        Constant Field Values
      • HEX_DIGITS

        private static final char[] HEX_DIGITS
    • Constructor Detail

      • OutputFileDigest

        private OutputFileDigest()
        Constructs an instance of OutputFileDigest.
    • Method Detail

      • getDigestLine

        public static java.lang.String getDigestLine​(java.security.DigestOutputStream digestStream)
        Creates the Digest Line.
        Parameters:
        digestStream -
      • getDigestStream

        public static java.security.DigestOutputStream getDigestStream​(java.io.OutputStream stream)
                                                                throws java.security.NoSuchAlgorithmException
        Create an MD5 DigestOutputStream for the provided OutputStream.
        Parameters:
        stream -
        Throws:
        java.security.NoSuchAlgorithmException
      • check

        public static boolean check​(java.io.File file,
                                    java.lang.String toolName,
                                    java.lang.String compatibleVersion,
                                    java.util.List<java.lang.String> options,
                                    Context context)
                             throws java.io.FileNotFoundException,
                                    java.io.IOException
        Check if the File already exists.
        Parameters:
        file -
        toolName -
        compatibleVersion -
        options -
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • checkVersion

        private static void checkVersion​(java.io.File file,
                                         java.lang.String toolName,
                                         java.lang.String versionId,
                                         Context context)
        Output a warning if the file was created with an incompatible version of JavaCC.
        Parameters:
        file -
        toolName -
        versionId -
      • checkOptions

        private static void checkOptions​(java.io.File file,
                                         java.lang.String[] options,
                                         Context context)
        Read the options line from the file and compare to the options currently in use. Output a warning if they are different.
        Parameters:
        file -
        options -
      • toHexString

        private static java.lang.String toHexString​(java.security.DigestOutputStream digestStream)