@Test(expected = IllegalArgumentException.class) public void testLoadFileChildResource_NotClasspathURI() throws Exception { final URI configFileUri = new URI(configFileUriString); final String resourceFileName = "resourceFile.txt"; final String uri = getFile(FileConfigFileLoader.class, resourceFileName).toURI().toString(); this.loader.loadFile(configFileUri, uri); }
@Override public byte[] loadFile(final URI fileURI) throws IOException { final Optional<URL> resources = loadResources(fileURI); if (resources.isPresent()) { return Files.readAllBytes(FileSystems.getDefault().getPath(resources.get().getPath())); } throw new NoSuchElementException(fileURI + " does not exist"); }
ClasspathConfigFileLoader implements ConfigFileLoaderPlugin { @Override public byte[] loadFile(final URI fileURI) throws IOException { final Optional<URL> resources = loadResources(fileURI); if (resources.isPresent()) { return Files.readAllBytes(FileSystems.getDefault().getPath(resources.get().getPath())); } throw new NoSuchElementException(fileURI + " does not exist"); } }
ClasspathConfigFileLoader implements ConfigFileLoaderPlugin { @Override public byte[] loadFile(final URI fileURI) throws IOException { final Optional<URL> resources = loadResources(fileURI); if (resources.isPresent()) { return Files.readAllBytes(FileSystems.getDefault().getPath(resources.get().getPath())); } throw new NoSuchElementException(fileURI + " does not exist"); }  }
ClasspathConfigFileLoader implements ConfigFileLoaderPlugin { @Override public byte[] loadFile(final URI fileURI) throws IOException { final Optional<URL> resources = loadResources(fileURI); if (resources.isPresent()) { return Files.readAllBytes(FileSystems.getDefault().getPath(resources.get().getPath())); } throw new NoSuchElementException(fileURI + " does not exist"); }  @Override Optional<File> toFile(final URI fileUri); @Override String getUriScheme(); @Override Optional<Long> lastModified(final URI fileURI); @Override boolean isAccessible(final URI fileURI); @Override byte[] loadFile(final URI fileURI); @Override boolean isAccessible(final URI configFileUri, final String pathToSubResource); @Override byte[] loadFile(final URI configFileUri, final String pathToSubResource); }
ClasspathConfigFileLoader implements ConfigFileLoaderPlugin { @Override public byte[] loadFile(final URI fileURI) throws IOException { final Optional<URL> resources = loadResources(fileURI); if (resources.isPresent()) { return Files.readAllBytes(FileSystems.getDefault().getPath(resources.get().getPath())); } throw new NoSuchElementException(fileURI + " does not exist"); }  @Override Optional<File> toFile(final URI fileUri); @Override String getUriScheme(); @Override Optional<Long> lastModified(final URI fileURI); @Override boolean isAccessible(final URI fileURI); @Override byte[] loadFile(final URI fileURI); @Override boolean isAccessible(final URI configFileUri, final String pathToSubResource); @Override byte[] loadFile(final URI configFileUri, final String pathToSubResource); static final String PREFIX; static final int PREFIX_LENGTH; }