Class BomUtils
java.lang.Object
org.cyclonedx.util.BomUtils
-
Method Summary
Modifier and TypeMethodDescriptioncalculateHashes(File file, Version schemaVersion) Calculates the hashes of the specified file.calculateHashes(File file, Version schemaVersion, List<Hash.Algorithm> algorithms) Calculates the hashes of the specified file using only the specified algorithms.static booleanvalidateUriString(String uri) static booleanvalidateUrlString(String url) Deprecated.
-
Method Details
-
calculateHashes
Calculates the hashes of the specified file.- Parameters:
file- the File to calculate hashes onschemaVersion- 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 onschemaVersion- 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 IOExceptionIllegalArgumentException- if an algorithm is not supported by the schema version- Since:
- 9.2.0
-
validateUrlString
Deprecated. -
validateUriString
-