From c097da60e620dcc3f609d86265c35d390dd32d88 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 29 May 2023 16:47:02 +0200 Subject: [PATCH] Improving library --- CHANGELOG.md | 5 +++++ pom.xml | 2 +- src/main/java/org/gcube/storagehub/MetadataMatcher.java | 3 +++ .../java/org/gcube/storagehub/StorageHubManagement.java | 8 ++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c927ce4..c47e1a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for StorageHub Application Persistence +## [v3.3.0-SNAPSHOT] + +- Added GENERATING_APPLICATION_NAME and GENERATING_APPLICATION_METADATA_VERSION to be used in Metadata + + ## [v3.2.0] - Added dependency to be able to compile with JDK 11 diff --git a/pom.xml b/pom.xml index 5bf2401..1053bb1 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.data-publishing storagehub-application-persistence - 3.2.0 + 3.3.0-SNAPSHOT StorageHub Application Persistence This library allows any application to persist in its workspace home any diff --git a/src/main/java/org/gcube/storagehub/MetadataMatcher.java b/src/main/java/org/gcube/storagehub/MetadataMatcher.java index 9c67ed9..662e53c 100644 --- a/src/main/java/org/gcube/storagehub/MetadataMatcher.java +++ b/src/main/java/org/gcube/storagehub/MetadataMatcher.java @@ -4,6 +4,9 @@ import org.gcube.common.storagehub.model.Metadata; public interface MetadataMatcher { + public static final String GENERATING_APPLICATION_NAME = "Generating Application Name"; + public static final String GENERATING_APPLICATION_METADATA_VERSION = "Generating Application Version"; + public boolean check(Metadata metadata); } diff --git a/src/main/java/org/gcube/storagehub/StorageHubManagement.java b/src/main/java/org/gcube/storagehub/StorageHubManagement.java index 3181fbf..8818dcd 100644 --- a/src/main/java/org/gcube/storagehub/StorageHubManagement.java +++ b/src/main/java/org/gcube/storagehub/StorageHubManagement.java @@ -200,8 +200,12 @@ public class StorageHubManagement { public void removePersistedFile(String filename, String mimeType) throws Exception { getPersistedFile(filename, mimeType); - if(this.persitedFile !=null) { - this.persitedFile.delete(); + removePersistedFile(this.persitedFile); + } + + public void removePersistedFile(FileContainer fileContainer) throws Exception { + if(fileContainer !=null) { + fileContainer.delete(); } }