@Test public void validStream() throws Exception { String content = "int a = 1"; InputStream input = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); assertThat(loader.load(input).get(new IntegerProperty("a"))).isEqualTo(1); }
@Override @SuppressWarnings("IllegalCatch") public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } try { return new DefProConfiguration(APIProvider.getAPI(file.getAbsolutePath())); } catch (Exception e) { throw new FileNotFoundException(e.getMessage()); } }
DefProConfigurationLoader implements ConfigurationLoader { @Override @SuppressWarnings("IllegalCatch") public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } try { return new DefProConfiguration(APIProvider.getAPI(file.getAbsolutePath())); } catch (Exception e) { throw new FileNotFoundException(e.getMessage()); } } }
DefProConfigurationLoader implements ConfigurationLoader { @Override @SuppressWarnings("IllegalCatch") public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } try { return new DefProConfiguration(APIProvider.getAPI(file.getAbsolutePath())); } catch (Exception e) { throw new FileNotFoundException(e.getMessage()); } }  }
DefProConfigurationLoader implements ConfigurationLoader { @Override @SuppressWarnings("IllegalCatch") public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } try { return new DefProConfiguration(APIProvider.getAPI(file.getAbsolutePath())); } catch (Exception e) { throw new FileNotFoundException(e.getMessage()); } }  @Override @SuppressWarnings("IllegalCatch") Configuration load(File file); @Override Configuration load(InputStream input); }
DefProConfigurationLoader implements ConfigurationLoader { @Override @SuppressWarnings("IllegalCatch") public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } try { return new DefProConfiguration(APIProvider.getAPI(file.getAbsolutePath())); } catch (Exception e) { throw new FileNotFoundException(e.getMessage()); } }  @Override @SuppressWarnings("IllegalCatch") Configuration load(File file); @Override Configuration load(InputStream input);  }