Class BomUtils

java.lang.Object
org.cyclonedx.util.BomUtils

public final class BomUtils extends Object
  • Method Details

    • calculateHashes

      public static List<Hash> calculateHashes(File file, Version schemaVersion) throws IOException
      Calculates the hashes of the specified file.
      Parameters:
      file - the File to calculate hashes on
      schemaVersion - enum denoting the schema version in use. Affects hash algorithm selection.
      Returns:
      a List of Hash objets
      Throws:
      IOException - an IOException
      Since:
      1.0.0
    • calculateHashes

      public static List<Hash> calculateHashes(File file, Version schemaVersion, List<Hash.Algorithm> algorithms) throws IOException
      Calculates the hashes of the specified file using only the specified algorithms.
      Parameters:
      file - the File to calculate hashes on
      schemaVersion - enum denoting the schema version in use. Affects hash algorithm selection.
      algorithms - the list of algorithms to calculate hashes for
      Returns:
      a List of Hash objects
      Throws:
      IOException - an IOException
      IllegalArgumentException - if an algorithm is not supported by the schema version
      Since:
      9.2.0
    • validateUrlString

      @Deprecated public static boolean validateUrlString(String url)
      Deprecated.
    • validateUriString

      public static boolean validateUriString(String uri)