@Test public void appendsToTheFile() throws Exception { Files.write(storageFile, Arrays.asList("Hello, I exist")); this.fileStorage.append("!evelyn-db"); assertThat(Files.readAllLines(storageFile)).containsExactly( "Hello, I exist", "!evelyn-db" ); }
@Override public void append(String data) { try { Files.write(location, Collections.singleton(data), StandardOpenOption.APPEND); } catch (IOException e) { throw new UncheckedIOException(e); } }
FileStorage extends StorageSupport { @Override public void append(String data) { try { Files.write(location, Collections.singleton(data), StandardOpenOption.APPEND); } catch (IOException e) { throw new UncheckedIOException(e); } } }
FileStorage extends StorageSupport { @Override public void append(String data) { try { Files.write(location, Collections.singleton(data), StandardOpenOption.APPEND); } catch (IOException e) { throw new UncheckedIOException(e); } } FileStorage(Path location); }
FileStorage extends StorageSupport { @Override public void append(String data) { try { Files.write(location, Collections.singleton(data), StandardOpenOption.APPEND); } catch (IOException e) { throw new UncheckedIOException(e); } } FileStorage(Path location); @Override String getReference(); @Override void append(String data); @Override Stream<String> read(Charset charset); }
FileStorage extends StorageSupport { @Override public void append(String data) { try { Files.write(location, Collections.singleton(data), StandardOpenOption.APPEND); } catch (IOException e) { throw new UncheckedIOException(e); } } FileStorage(Path location); @Override String getReference(); @Override void append(String data); @Override Stream<String> read(Charset charset);  }