Skip to content

Commit

Permalink
Use getRaf which also works for s3 files
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrwenski committed Jul 13, 2023
1 parent edaa14e commit 1267af5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion grib/src/main/java/ucar/nc2/grib/grib1/Grib1Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.google.protobuf.ByteString;
import java.nio.charset.StandardCharsets;
import thredds.inventory.CollectionUpdateType;
import ucar.nc2.NetcdfFiles;
import ucar.nc2.grib.GribIndex;
import ucar.nc2.grib.GribIndexCache;
import ucar.nc2.stream.NcStream;
Expand Down Expand Up @@ -185,7 +186,7 @@ public boolean makeIndex(String filename, RandomAccessFile dataRaf) throws IOExc
rootBuilder.setFilename(filename);

if (dataRaf == null) { // open if dataRaf not already open
raf = RandomAccessFile.acquire(filename);
raf = NetcdfFiles.getRaf(filename, -1);
dataRaf = raf;
}

Expand Down
3 changes: 2 additions & 1 deletion grib/src/main/java/ucar/nc2/grib/grib2/Grib2Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.google.protobuf.ByteString;
import java.nio.charset.StandardCharsets;
import thredds.inventory.CollectionUpdateType;
import ucar.nc2.NetcdfFiles;
import ucar.nc2.grib.GribIndex;
import ucar.nc2.grib.GribIndexCache;
import ucar.nc2.stream.NcStream;
Expand Down Expand Up @@ -221,7 +222,7 @@ public boolean makeIndex(String filename, RandomAccessFile dataRaf) throws IOExc
rootBuilder.setFilename(filename);

if (dataRaf == null) {
raf = RandomAccessFile.acquire(filename);
raf = NetcdfFiles.getRaf(filename, -1);
dataRaf = raf;
}

Expand Down

0 comments on commit 1267af5

Please sign in to comment.