@Test public void loadOnNondirectory() throws IOException { final Path randomFile = Files.createTempFile("other", ".txt"); final Throwable throwable = catchThrowable(() -> loader.load(randomFile)); assertThat(throwable) .isNotNull() .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("doesn't exist or is not a directory"); }
@Override public void load(final Path directory) throws IOException { if (!Files.isDirectory(directory)) { throw new IllegalArgumentException(directory.toString() + " doesn't exist or is not a directory"); } this.fileListIterator = Files.list(directory).iterator(); }
DirectoryStoreFile implements StoreLoader { @Override public void load(final Path directory) throws IOException { if (!Files.isDirectory(directory)) { throw new IllegalArgumentException(directory.toString() + " doesn't exist or is not a directory"); } this.fileListIterator = Files.list(directory).iterator(); } }
DirectoryStoreFile implements StoreLoader { @Override public void load(final Path directory) throws IOException { if (!Files.isDirectory(directory)) { throw new IllegalArgumentException(directory.toString() + " doesn't exist or is not a directory"); } this.fileListIterator = Files.list(directory).iterator(); }  }
DirectoryStoreFile implements StoreLoader { @Override public void load(final Path directory) throws IOException { if (!Files.isDirectory(directory)) { throw new IllegalArgumentException(directory.toString() + " doesn't exist or is not a directory"); } this.fileListIterator = Files.list(directory).iterator(); }  @Override void load(final Path directory); @Override DataEntry nextEntry(); }
DirectoryStoreFile implements StoreLoader { @Override public void load(final Path directory) throws IOException { if (!Files.isDirectory(directory)) { throw new IllegalArgumentException(directory.toString() + " doesn't exist or is not a directory"); } this.fileListIterator = Files.list(directory).iterator(); }  @Override void load(final Path directory); @Override DataEntry nextEntry();  }