Class MojoUtils


  • class MojoUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      MojoUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] checksum​(java.io.File file)
      Creates the MD5 checksum for the given file.
      static java.lang.String findSourceSubdir​(java.io.File sourceDirectory, java.io.File grammarFile)
      Given the source directory File object and the full PATH to a grammar, produce the path to the named grammar file in relative terms to the sourceDirectory.
      • Methods inherited from class java.lang.Object

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

      • MojoUtils

        MojoUtils()
    • Method Detail

      • checksum

        public static byte[] checksum​(java.io.File file)
                               throws java.io.IOException
        Creates the MD5 checksum for the given file.
        Parameters:
        file - the file.
        Returns:
        the checksum.
        Throws:
        java.io.IOException
      • findSourceSubdir

        public static java.lang.String findSourceSubdir​(java.io.File sourceDirectory,
                                                        java.io.File grammarFile)
        Given the source directory File object and the full PATH to a grammar, produce the path to the named grammar file in relative terms to the sourceDirectory. This will then allow ANTLR to produce output relative to the base of the output directory and reflect the input organization of the grammar files.
        Parameters:
        sourceDirectory - The source directory File object
        grammarFile - The full path to the input grammar file
        Returns:
        The path to the grammar file relative to the source directory