@Test public void shouldHandleNonExistingFile() { Assertions.assertThatExceptionOfType(LifecycleExecutionException.class) .isThrownBy(() -> loader.load(Paths.get("doesNotExist"), logger)); }
@Override protected List<Repository> load(Path filePath, Logger logger) throws LifecycleExecutionException { List<Repository> repositoryList = new ArrayList<>(); try { Properties props = new Properties(); props.load(new StringReader(new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8))); for (Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); if (name.startsWith("yaks.repository.")) { repositoryList.add(build(name.substring("yaks.repository.".length()), props.getProperty(name), logger)); } } } catch (IOException e) { throw new LifecycleExecutionException("Failed to load properties from repository configuration file", e); } return repositoryList; }
PropertyFileRepositoryLoader extends AbstractConfigFileRepositoryLoader { @Override protected List<Repository> load(Path filePath, Logger logger) throws LifecycleExecutionException { List<Repository> repositoryList = new ArrayList<>(); try { Properties props = new Properties(); props.load(new StringReader(new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8))); for (Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); if (name.startsWith("yaks.repository.")) { repositoryList.add(build(name.substring("yaks.repository.".length()), props.getProperty(name), logger)); } } } catch (IOException e) { throw new LifecycleExecutionException("Failed to load properties from repository configuration file", e); } return repositoryList; } }
PropertyFileRepositoryLoader extends AbstractConfigFileRepositoryLoader { @Override protected List<Repository> load(Path filePath, Logger logger) throws LifecycleExecutionException { List<Repository> repositoryList = new ArrayList<>(); try { Properties props = new Properties(); props.load(new StringReader(new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8))); for (Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); if (name.startsWith("yaks.repository.")) { repositoryList.add(build(name.substring("yaks.repository.".length()), props.getProperty(name), logger)); } } } catch (IOException e) { throw new LifecycleExecutionException("Failed to load properties from repository configuration file", e); } return repositoryList; }  }
PropertyFileRepositoryLoader extends AbstractConfigFileRepositoryLoader { @Override protected List<Repository> load(Path filePath, Logger logger) throws LifecycleExecutionException { List<Repository> repositoryList = new ArrayList<>(); try { Properties props = new Properties(); props.load(new StringReader(new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8))); for (Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); if (name.startsWith("yaks.repository.")) { repositoryList.add(build(name.substring("yaks.repository.".length()), props.getProperty(name), logger)); } } } catch (IOException e) { throw new LifecycleExecutionException("Failed to load properties from repository configuration file", e); } return repositoryList; }   }
PropertyFileRepositoryLoader extends AbstractConfigFileRepositoryLoader { @Override protected List<Repository> load(Path filePath, Logger logger) throws LifecycleExecutionException { List<Repository> repositoryList = new ArrayList<>(); try { Properties props = new Properties(); props.load(new StringReader(new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8))); for (Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); if (name.startsWith("yaks.repository.")) { repositoryList.add(build(name.substring("yaks.repository.".length()), props.getProperty(name), logger)); } } } catch (IOException e) { throw new LifecycleExecutionException("Failed to load properties from repository configuration file", e); } return repositoryList; }    }