@Test public void testCanOpen() { assertThat(NetcdfFiles.canOpen(TestDir.cdmLocalTestDataDir + "longOffset.nc")).isTrue(); assertThat(NetcdfFiles.canOpen(TestDir.cdmLocalTestDataDir + "sunya.nc")).isFalse(); assertThat(NetcdfFiles.canOpen(TestDir.cdmLocalTestDataDir + "testUnsignedFillValueNew.dump")).isFalse(); }
public static boolean canOpen(String location) { boolean canOpen = false; try (ucar.unidata.io.RandomAccessFile raf = getRaf(location, -1)) { log.info(String.format("%s can be accessed with %s", raf.getLocation(), raf.getClass())); IOServiceProvider iosp = getIosp(raf); if (iosp != null) { canOpen = true; log.info(String.format("%s can be opened by %s", raf.getLocation(), iosp.getClass())); } } catch (IOException e) { return false; } return canOpen; }
NetcdfFiles { public static boolean canOpen(String location) { boolean canOpen = false; try (ucar.unidata.io.RandomAccessFile raf = getRaf(location, -1)) { log.info(String.format("%s can be accessed with %s", raf.getLocation(), raf.getClass())); IOServiceProvider iosp = getIosp(raf); if (iosp != null) { canOpen = true; log.info(String.format("%s can be opened by %s", raf.getLocation(), iosp.getClass())); } } catch (IOException e) { return false; } return canOpen; } }
NetcdfFiles { public static boolean canOpen(String location) { boolean canOpen = false; try (ucar.unidata.io.RandomAccessFile raf = getRaf(location, -1)) { log.info(String.format("%s can be accessed with %s", raf.getLocation(), raf.getClass())); IOServiceProvider iosp = getIosp(raf); if (iosp != null) { canOpen = true; log.info(String.format("%s can be opened by %s", raf.getLocation(), iosp.getClass())); } } catch (IOException e) { return false; } return canOpen; }  }
NetcdfFiles { public static boolean canOpen(String location) { boolean canOpen = false; try (ucar.unidata.io.RandomAccessFile raf = getRaf(location, -1)) { log.info(String.format("%s can be accessed with %s", raf.getLocation(), raf.getClass())); IOServiceProvider iosp = getIosp(raf); if (iosp != null) { canOpen = true; log.info(String.format("%s can be opened by %s", raf.getLocation(), iosp.getClass())); } } catch (IOException e) { return false; } return canOpen; }  static void registerIOProvider(String className); static void registerIOProvider(Class<?> iospClass); static void registerRandomAccessFileProvider(String className); static void registerRandomAccessFileProvider(Class<?> rafClass); static NetcdfFile open(String location); static NetcdfFile open(String location, ucar.nc2.util.CancelTask cancelTask); static NetcdfFile open(String location, int buffer_size, ucar.nc2.util.CancelTask cancelTask); static NetcdfFile open(String location, int buffer_size, ucar.nc2.util.CancelTask cancelTask,
      Object iospMessage); static NetcdfFile open(String location, String iospClassName, int bufferSize, CancelTask cancelTask,
      Object iospMessage); static boolean canOpen(String location); static NetcdfFile openInMemory(String filename); static NetcdfFile openInMemory(URI uri); static NetcdfFile openInMemory(String name, byte[] data); static NetcdfFile openInMemory(String name, byte[] data, String iospClassName); static NetcdfFile open(ucar.unidata.io.RandomAccessFile raf, String location,
      @Nullable ucar.nc2.util.CancelTask cancelTask, @Nullable Object iospMessage); static NetcdfFile build(IOServiceProvider spi, ucar.unidata.io.RandomAccessFile raf, String location,
      ucar.nc2.util.CancelTask cancelTask); static String makeValidCdmObjectName(String shortName); static String makeValidCDLName(String vname); static String makeValidPathName(String vname); static String makeNameUnescaped(String vname); static String makeFullName(Group g); static String makeFullName(Variable v); static String makeFullNameSectionSpec(Variable v); }
NetcdfFiles { public static boolean canOpen(String location) { boolean canOpen = false; try (ucar.unidata.io.RandomAccessFile raf = getRaf(location, -1)) { log.info(String.format("%s can be accessed with %s", raf.getLocation(), raf.getClass())); IOServiceProvider iosp = getIosp(raf); if (iosp != null) { canOpen = true; log.info(String.format("%s can be opened by %s", raf.getLocation(), iosp.getClass())); } } catch (IOException e) { return false; } return canOpen; }  static void registerIOProvider(String className); static void registerIOProvider(Class<?> iospClass); static void registerRandomAccessFileProvider(String className); static void registerRandomAccessFileProvider(Class<?> rafClass); static NetcdfFile open(String location); static NetcdfFile open(String location, ucar.nc2.util.CancelTask cancelTask); static NetcdfFile open(String location, int buffer_size, ucar.nc2.util.CancelTask cancelTask); static NetcdfFile open(String location, int buffer_size, ucar.nc2.util.CancelTask cancelTask,
      Object iospMessage); static NetcdfFile open(String location, String iospClassName, int bufferSize, CancelTask cancelTask,
      Object iospMessage); static boolean canOpen(String location); static NetcdfFile openInMemory(String filename); static NetcdfFile openInMemory(URI uri); static NetcdfFile openInMemory(String name, byte[] data); static NetcdfFile openInMemory(String name, byte[] data, String iospClassName); static NetcdfFile open(ucar.unidata.io.RandomAccessFile raf, String location,
      @Nullable ucar.nc2.util.CancelTask cancelTask, @Nullable Object iospMessage); static NetcdfFile build(IOServiceProvider spi, ucar.unidata.io.RandomAccessFile raf, String location,
      ucar.nc2.util.CancelTask cancelTask); static String makeValidCdmObjectName(String shortName); static String makeValidCDLName(String vname); static String makeValidPathName(String vname); static String makeNameUnescaped(String vname); static String makeFullName(Group g); static String makeFullName(Variable v); static String makeFullNameSectionSpec(Variable v); static final String reservedFullName; }