Skip to content

Commit

Permalink
Add the "fileName" and "key" properties as listed in the later versio…
Browse files Browse the repository at this point in the history
…n of the cumulus granule file schema (#216)

* add fileName property in buildS3GranuleFile function

* add key property in buildS3GranuleFile function

* fix key property in buildS3GranuleFile function

* script comments added

* add changes to CHANGELOG.md

* adapt changes to CHANGELOG.md

---------

Co-authored-by: Hailiang Zhang <[email protected]>
  • Loading branch information
hailiangzhang and HailiangZhangNASA authored Mar 6, 2024
1 parent 2a4abfb commit ad765bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -168,4 +170,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

### Security
### Security
4 changes: 4 additions & 0 deletions src/main/java/gov/nasa/cumulus/CnmToGranuleHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ad765bf

Please sign in to comment.