Skip to content

Commit f5be4a8

Browse files
committed
confirm that it works on S3, leave note #9331
1 parent 09490f0 commit f5be4a8

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/java/edu/harvard/iq/dataverse/ingest/IngestServiceBean.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,16 @@ public boolean extractMetadata(String tempFileLocation, DataFile dataFile, Datas
13071307
* Also consider merging with extractMetadataNcml() but while NcML should be
13081308
* extractable from all files that the NetCDF Java library can open only
13091309
* some NetCDF files will have a bounding box.
1310+
*
1311+
* Note that if we ever create an API endpoint for this method for files
1312+
* that are already persisted to disk or S3, we will need to use something
1313+
* like getExistingFile() from extractMetadataNcml() to pull the file down
1314+
* from S3 to a temporary file location on local disk so that it can
1315+
* (ultimately) be opened by the NetcdfFiles.open() method, which only
1316+
* operates on local files (not an input stream). What we have now is not a
1317+
* problem for S3 because the files are saved locally before the are
1318+
* uploaded to S3. It's during this time that the files are local that this
1319+
* method is run.
13101320
*/
13111321
public boolean extractMetadataFromNetcdf(String tempFileLocation, DataFile dataFile, DatasetVersion editVersion) throws IOException {
13121322
boolean ingestSuccessful = false;
@@ -1328,7 +1338,6 @@ public boolean extractMetadataFromNetcdf(String tempFileLocation, DataFile dataF
13281338
// it up with the Ingest Service Provider Registry:
13291339
NetcdfFileMetadataExtractor extractorPlugin = new NetcdfFileMetadataExtractor();
13301340
logger.fine("creating file from " + tempFileLocation);
1331-
// FIXME: this won't work with S3!
13321341
File file = new File(tempFileLocation);
13331342
FileMetadataIngest extractedMetadata = extractorPlugin.ingestFile(file);
13341343
Map<String, Set<String>> extractedMetadataMap = extractedMetadata.getMetadataMap();

0 commit comments

Comments
 (0)