Class OutputFileDigest
java.lang.Object
org.javacc.utils.OutputFileDigest
The
OutputFileDigest class.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classTheOutputFileDigest.NullOutputStreamimplements anOutputStreamto the null device. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck if the File already exists.private static voidcheckOptions(File file, String[] options, Context context) Read the options line from the file and compare to the options currently in use.private static voidcheckVersion(File file, String toolName, String versionId, Context context) Output a warning if the file was created with an incompatible version of JavaCC.static StringgetDigestLine(DigestOutputStream digestStream) Creates the Digest Line.static DigestOutputStreamgetDigestStream(OutputStream stream) Create an MD5DigestOutputStreamfor the providedOutputStream.private static StringtoHexString(DigestOutputStream digestStream)
-
Field Details
-
MD5_LINE_PART_1
- See Also:
-
MD5_LINE_PART_1q
- See Also:
-
MD5_LINE_PART_2
- See Also:
-
MD5_LINE_PART_2q
- See Also:
-
HEX_DIGITS
private static final char[] HEX_DIGITS
-
-
Constructor Details
-
OutputFileDigest
private OutputFileDigest()Constructs an instance ofOutputFileDigest.
-
-
Method Details
-
getDigestLine
Creates the Digest Line.- Parameters:
digestStream-
-
getDigestStream
public static DigestOutputStream getDigestStream(OutputStream stream) throws NoSuchAlgorithmException Create an MD5DigestOutputStreamfor the providedOutputStream.- Parameters:
stream-- Throws:
NoSuchAlgorithmException
-
check
public static boolean check(File file, String toolName, String compatibleVersion, List<String> options, Context context) throws FileNotFoundException, IOException Check if the File already exists.- Parameters:
file-toolName-compatibleVersion-options-- Throws:
FileNotFoundExceptionIOException
-
checkVersion
-
checkOptions
-
toHexString
-