SW360AttachmentUtils { public static String calculateSha1Hash(Path file) { try { return calculateHash(file, MessageDigest.getInstance(ALG_SHA1)); } catch (NoSuchAlgorithmException e) { throw new AssertionError("SHA-1 algorithm not supported"); } } private  SW360AttachmentUtils(); static CompletableFuture<AttachmentUploadResult<T>> uploadAttachments(SW360AttachmentAwareClient<T> client, AttachmentUploadRequest<T> uploadRequest,
                      Function<? super T, Set<SW360SparseAttachment>> getAttachmentsFunc); static CompletableFuture<Optional<Path>> downloadAttachment(SW360AttachmentAwareClient<? extends T> client, T entity, SW360SparseAttachment attachment,
                       Path downloadPath); static AttachmentDownloadProcessor defaultAttachmentDownloadProcessor(SW360SparseAttachment attachment,
                                                                                 Path downloadPath); static AttachmentDownloadProcessor defaultAttachmentDownloadProcessor(String fileName, Path downloadPath); static String calculateHash(Path file, MessageDigest digest); static String calculateSha1Hash(Path file);  }
@Test public void testCalculateSha1Hash() throws URISyntaxException { checkFileDownloaded(testFile()); }