Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove quava dependency #103

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions hawkbit-extension-artifact-repository-azure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@
<artifactId>hawkbit-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions hawkbit-extension-artifact-repository-gcs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
<artifactId>hawkbit-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.Base64;
import java.util.HexFormat;

import org.apache.commons.io.IOUtils;
import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact;
Expand All @@ -27,7 +28,6 @@
import com.google.cloud.storage.BlobId;
import com.google.cloud.storage.BlobInfo;
import com.google.cloud.storage.Storage;
import com.google.common.io.BaseEncoding;

/**
* An {@link ArtifactRepository} implementation for the Gcloud GCS service. All
Expand Down Expand Up @@ -113,7 +113,7 @@ public AbstractDbArtifact getArtifactBySha1(final String tenant, final String sh
// the MD5Content is stored in the ETag
return new GcsArtifact(gcsStorage, gcsProperties, key, sha1Hash,
new DbArtifactHash(sha1Hash,
BaseEncoding.base16().lowerCase().encode(Base64.getDecoder().decode(blob.getMd5())), null),
HexFormat.of().withLowerCase().formatHex(Base64.getDecoder().decode(blob.getMd5())), null),
blob.getSize(), blob.getContentType());

}
Expand Down
4 changes: 0 additions & 4 deletions hawkbit-extension-artifact-repository-mongo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<!-- TEST -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HexFormat;
import java.util.Random;

import io.qameta.allure.Description;
Expand All @@ -27,8 +28,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import com.google.common.io.BaseEncoding;

import io.qameta.allure.Feature;
import io.qameta.allure.Step;
import io.qameta.allure.Story;
Expand Down Expand Up @@ -90,9 +89,10 @@ public void storeSameArtifactMultipleTimes() throws NoSuchAlgorithmException, IO
final MessageDigest mdSHA1 = MessageDigest.getInstance("SHA1");
final MessageDigest mdSHA256 = MessageDigest.getInstance("SHA-256");
final MessageDigest mdMD5 = MessageDigest.getInstance("MD5");
final DbArtifactHash hash = new DbArtifactHash(BaseEncoding.base16().lowerCase().encode(mdSHA1.digest(bytes)),
BaseEncoding.base16().lowerCase().encode(mdMD5.digest(bytes)),
BaseEncoding.base16().lowerCase().encode(mdSHA256.digest(bytes)));
final HexFormat hexFormat = HexFormat.of().withLowerCase();
final DbArtifactHash hash = new DbArtifactHash(hexFormat.formatHex(mdSHA1.digest(bytes)),
hexFormat.formatHex(mdMD5.digest(bytes)),
hexFormat.formatHex(mdSHA256.digest(bytes)));

final AbstractDbArtifact artifact1 = storeArtifact(TENANT, "file1.txt", new ByteArrayInputStream(bytes), mdSHA1,
mdMD5, hash);
Expand All @@ -111,8 +111,9 @@ private String storeRandomArtifactAndVerify(final String tenant) throws NoSuchAl

storeArtifact(tenant, filename, generateInputStream(filelengthBytes), mdSHA1, mdMD5, null);

final String sha1Hash16 = BaseEncoding.base16().lowerCase().encode(mdSHA1.digest());
final String md5Hash16 = BaseEncoding.base16().lowerCase().encode(mdMD5.digest());
final HexFormat hexFormat = HexFormat.of().withLowerCase();
final String sha1Hash16 = hexFormat.formatHex(mdSHA1.digest());
final String md5Hash16 = hexFormat.formatHex(mdMD5.digest());

final AbstractDbArtifact loaded = artifactStoreUnderTest.getArtifactBySha1(tenant, sha1Hash16);
assertThat(loaded).isNotNull();
Expand Down
4 changes: 0 additions & 4 deletions hawkbit-extension-artifact-repository-s3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
Expand Down