@Test public void existsTest() { assertTrue(new PsseImporter().exists(new ResourceDataSource("IEEE_14_bus", new ResourceSet("/", "IEEE_14_bus.raw")))); assertTrue(new PsseImporter().exists(new ResourceDataSource("IEEE_30_bus", new ResourceSet("/", "IEEE_30_bus.RAW")))); assertFalse(new PsseImporter().exists(new ResourceDataSource("IEEE_14_bus", new ResourceSet("/", "IEEE_14_bus.json")))); assertFalse(new PsseImporter().exists(new ResourceDataSource("fake", new ResourceSet("/", "fake.raw")))); assertFalse(new PsseImporter().exists(new ResourceDataSource("case-flag-not-supported", new ResourceSet("/", "case-flag-not-supported.raw")))); assertFalse(new PsseImporter().exists(new ResourceDataSource("version-not-supported", new ResourceSet("/", "version-not-supported.raw")))); }
@Override public boolean exists(ReadOnlyDataSource dataSource) { try { String ext = findExtension(dataSource, false); if (ext != null) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(dataSource.newInputStream(null, ext)))) { return new PsseRawReader().checkCaseIdentification(reader); } } } catch (IOException e) { throw new UncheckedIOException(e); } return false; }
PsseImporter implements Importer { @Override public boolean exists(ReadOnlyDataSource dataSource) { try { String ext = findExtension(dataSource, false); if (ext != null) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(dataSource.newInputStream(null, ext)))) { return new PsseRawReader().checkCaseIdentification(reader); } } } catch (IOException e) { throw new UncheckedIOException(e); } return false; } }
PsseImporter implements Importer { @Override public boolean exists(ReadOnlyDataSource dataSource) { try { String ext = findExtension(dataSource, false); if (ext != null) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(dataSource.newInputStream(null, ext)))) { return new PsseRawReader().checkCaseIdentification(reader); } } } catch (IOException e) { throw new UncheckedIOException(e); } return false; }  }
PsseImporter implements Importer { @Override public boolean exists(ReadOnlyDataSource dataSource) { try { String ext = findExtension(dataSource, false); if (ext != null) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(dataSource.newInputStream(null, ext)))) { return new PsseRawReader().checkCaseIdentification(reader); } } } catch (IOException e) { throw new UncheckedIOException(e); } return false; }  @Override String getFormat(); @Override List<Parameter> getParameters(); @Override String getComment(); @Override boolean exists(ReadOnlyDataSource dataSource); @Override void copy(ReadOnlyDataSource fromDataSource, DataSource toDataSource); @Override Network importData(ReadOnlyDataSource dataSource, NetworkFactory networkFactory, Properties parameters); }
PsseImporter implements Importer { @Override public boolean exists(ReadOnlyDataSource dataSource) { try { String ext = findExtension(dataSource, false); if (ext != null) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(dataSource.newInputStream(null, ext)))) { return new PsseRawReader().checkCaseIdentification(reader); } } } catch (IOException e) { throw new UncheckedIOException(e); } return false; }  @Override String getFormat(); @Override List<Parameter> getParameters(); @Override String getComment(); @Override boolean exists(ReadOnlyDataSource dataSource); @Override void copy(ReadOnlyDataSource fromDataSource, DataSource toDataSource); @Override Network importData(ReadOnlyDataSource dataSource, NetworkFactory networkFactory, Properties parameters);  }