@@ -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