Small Artifact storage refactoring (#2648)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -215,7 +215,7 @@ public class JpaArtifactManagement implements ArtifactManagement {
|
||||
private StoredArtifactInfo storeArtifact(final ArtifactUpload artifactUpload, final boolean isSmEncrypted) {
|
||||
final InputStream stream = artifactUpload.inputStream();
|
||||
try (final InputStream wrappedStream = wrapInQuotaStream(
|
||||
isSmEncrypted ? wrapInEncryptionStream(artifactUpload.moduleId(), stream) : stream)) {
|
||||
isSmEncrypted ? ArtifactEncryptionService.getInstance().encryptArtifact(artifactUpload.moduleId(), stream) : stream)) {
|
||||
return artifactStorage.store(
|
||||
tenantAware.getCurrentTenant(),
|
||||
wrappedStream, artifactUpload.filename(),
|
||||
@@ -233,10 +233,6 @@ public class JpaArtifactManagement implements ArtifactManagement {
|
||||
}
|
||||
}
|
||||
|
||||
private InputStream wrapInEncryptionStream(final long smId, final InputStream stream) {
|
||||
return ArtifactEncryptionService.getInstance().encryptArtifact(smId, stream);
|
||||
}
|
||||
|
||||
private InputStream wrapInQuotaStream(final InputStream in) {
|
||||
final long maxArtifactSize = quotaManagement.getMaxArtifactSize();
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ public abstract class AbstractIntegrationTest {
|
||||
|
||||
@BeforeAll
|
||||
public static void beforeClass() {
|
||||
System.setProperty("org.eclipse.hawkbit.repository.file.path", ARTIFACT_DIRECTORY);
|
||||
System.setProperty("org.eclipse.hawkbit.artifact.fs.path", ARTIFACT_DIRECTORY);
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
|
||||
Reference in New Issue
Block a user