Class ChecksumAlgorithmHelper

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.String> calculate​(byte[] data, java.util.List<ChecksumAlgorithmFactory> factories)
      Calculates checksums for specified data.
      static java.util.Map<java.lang.String,​java.lang.String> calculate​(java.io.File file, java.util.List<ChecksumAlgorithmFactory> factories)
      Calculates checksums for specified file.
      • Methods inherited from class java.lang.Object

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

      • calculate

        public static java.util.Map<java.lang.String,​java.lang.String> calculate​(byte[] data,
                                                                                       java.util.List<ChecksumAlgorithmFactory> factories)
                                                                                throws java.io.IOException
        Calculates checksums for specified data.
        Parameters:
        data - The content for which to calculate checksums, must not be null.
        factories - The checksum algorithm factories to use, must not be null.
        Returns:
        The calculated checksums, indexed by algorithm name, or the exception that occurred while trying to calculate it, never null.
        Throws:
        java.io.IOException - In case of any problem.
      • calculate

        public static java.util.Map<java.lang.String,​java.lang.String> calculate​(java.io.File file,
                                                                                       java.util.List<ChecksumAlgorithmFactory> factories)
                                                                                throws java.io.IOException
        Calculates checksums for specified file.
        Parameters:
        file - The file for which to calculate checksums, must not be null.
        factories - The checksum algorithm factories to use, must not be null.
        Returns:
        The calculated checksums, indexed by algorithm name, or the exception that occurred while trying to calculate it, never null.
        Throws:
        java.io.IOException - In case of any problem.