public NetcdfFile open(DatasetUrl location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException { return new CdmRemote(location.trueurl); } }
throw new FileNotFoundException(getErrorMessage(method)); throw new IOException(getErrorMessage(method)); for (Variable v : getVariables()) { StringBuilder sbuff = new StringBuilder(remoteURI); sbuff.append("?var="); throw new FileNotFoundException(getErrorMessage(method)); throw new IOException(getErrorMessage(method));
@Override public InputStream getInputStream() throws IOException { return CdmRemote.sendQuery(null, uri, queryMaker.makeQuery()); }
@Test public void testChardata() { // was failing on char data being sign extended try { String filename = "/netcdf3/files/c0_64.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath+filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, false, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }
String curl = CdmRemote.canonicalURL(datasetLocation); ds = acquire ? NetcdfDataset.acquireDataset(curl, enhanceMode, task) : NetcdfDataset.openDataset(curl, enhanceMode, task);
StructureDataIterator siter = getStructureIterator(s, -1); return new ArraySequence(s.makeStructureMembers(), siter, -1); int statusCode = method.execute(); if (statusCode == 404) throw new FileNotFoundException(getErrorMessage(method)); throw new IOException(getErrorMessage(method));
StructureDataIterator siter = getStructureIterator(s, -1); return new ArraySequence(s.makeStructureMembers(), siter, -1);
for (Variable v : getVariables()) { StringBuilder sbuff = new StringBuilder(remoteURI); sbuff.append("?var=");
throw new FileNotFoundException(getErrorMessage(method)); throw new IOException(getErrorMessage(method));
@Test public void testByteOrder() { try { String filename = "/netcdf3/longOffset.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath + filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, true, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }
String curl = CdmRemote.canonicalURL(datasetLocation); ds = acquire ? NetcdfDataset.acquireDataset(curl, enhanceMode, task) : NetcdfDataset.openDataset(curl, enhanceMode, task);
StructureDataIterator siter = getStructureIterator(s, -1); return new ArraySequence(s.makeStructureMembers(), siter, -1);
for (Variable v : getVariables()) { StringBuilder sbuff = new StringBuilder(remoteURI); sbuff.append("?var=");
public NetcdfFile open(String location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException { return new CdmRemote(location); } }
@Test public void testVlen() { try { String filename = "/netcdf4/vlen/tst_vl.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath+filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, false, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }
protected StructureDataIterator getStructureIterator(Structure s, int bufferSize) throws java.io.IOException { try { InputStream is = sendQuery(remoteURI, s.getFullNameEscaped()); NcStreamReader reader = new NcStreamReader(); return reader.getStructureIterator(is, this); } catch (Throwable e) { e.printStackTrace(); throw new IllegalStateException(e); } }
String curl = CdmRemote.canonicalURL(datasetLocation); ds = acquire ? NetcdfDataset.acquireDataset(DatasetUrl.findDatasetUrl(curl), enhanceMode, task) : NetcdfDataset.openDataset(curl, enhanceMode, task);
public NetcdfFile open(String location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException { return new CdmRemote(location); } }
@Test public void testVlenInStructure() { try { String filename = "/netcdf4/vlen/IntTimSciSamp.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath+filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, false, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }
protected StructureDataIterator getStructureIterator(Structure s, int bufferSize) throws java.io.IOException { try { InputStream is = sendQuery(httpClient, remoteURI, s.getFullNameEscaped()); NcStreamReader reader = new NcStreamReader(); return reader.getStructureIterator(is, this); } catch (Throwable e) { e.printStackTrace(); throw new IllegalStateException(e); } }