Class FileMetadata


  • @Immutable
    public class FileMetadata
    extends java.lang.Object
    Computes hash of files. Ends of Lines are ignored, so files with same content but different EOL encoding have the same hash.
    • Constructor Detail

      • FileMetadata

        public FileMetadata()
    • Method Detail

      • readMetadata

        public Metadata readMetadata​(java.io.InputStream stream,
                                     java.nio.charset.Charset encoding,
                                     java.lang.String filePath,
                                     @Nullable
                                     CharHandler otherHandler)
        Compute hash of a file ignoring line ends differences. Maximum performance is needed.
      • readMetadata

        public Metadata readMetadata​(java.io.InputStream stream,
                                     java.nio.charset.Charset encoding,
                                     java.lang.String filePath)
      • readMetadata

        public Metadata readMetadata​(java.io.Reader reader)
        For testing purpose
      • readFile

        public static void readFile​(java.io.InputStream stream,
                                    java.nio.charset.Charset encoding,
                                    java.lang.String filePath,
                                    CharHandler[] handlers)
      • computeLineHashesForIssueTracking

        public static void computeLineHashesForIssueTracking​(InputFile f,
                                                             FileMetadata.LineHashConsumer consumer)
        Compute a MD5 hash of each line of the file after removing of all blank chars