diff --git a/CHANGELOG.md b/CHANGELOG.md index be0398d..749a2a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.8.0] ### Added +- **User contribution** + - Add the "fileName" and "key" properties to the granuleFile object from buildS3GranuleFile function ### Changed - **PODAAC-5877** - Support java 11 @@ -168,4 +170,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -### Security \ No newline at end of file +### Security diff --git a/src/main/java/gov/nasa/cumulus/CnmToGranuleHandler.java b/src/main/java/gov/nasa/cumulus/CnmToGranuleHandler.java index f2adac5..ea737c7 100644 --- a/src/main/java/gov/nasa/cumulus/CnmToGranuleHandler.java +++ b/src/main/java/gov/nasa/cumulus/CnmToGranuleHandler.java @@ -208,6 +208,10 @@ public JsonObject buildS3GranuleFile(JsonObject cnmFile) { granuleFile.addProperty("checksum", cnmFile.get("checksum").getAsString()); } granuleFile.addProperty("type", cnmFile.get("type").getAsString()); + + // Add the "fileName" and "key" properties as listed in the later version of the cumulus granule file schema + granuleFile.addProperty("fileName", cnmFile.get("name").getAsString()); + granuleFile.addProperty("key", url_path + '/' + cnmFile.get("name").getAsString()); return granuleFile; }