@Test() public void appendTest() throws IOException { StorageLogbookParameters params1 = buildStorageParameters("params1"); StorageLogbookParameters params2 = buildStorageParameters("params2"); StorageLogbookParameters params3 = buildStorageParameters("params3"); Path filePath = folder.getRoot().toPath().resolve(GUIDFactory.newGUID().toString()); try (StorageLogAppender instance = new StorageLogAppender(filePath)) { instance.append(params1); instance.append(params2); instance.append(params3); } assertThat(filePath).exists(); assertThat(Files.readAllBytes(filePath)) .isEqualTo("{\"objectIdentifier\":\"params1\"}\n{\"objectIdentifier\":\"params2\"}\n{\"objectIdentifier\":\"params3\"}\n".getBytes()); }
public void append(StorageLogStructure parameters) throws IOException { writer.append(JsonHandler.unprettyPrint(parameters.getMapParameters())); writer.append(lineSeparator); writer.flush(); }
StorageLogAppender implements VitamAutoCloseable { public void append(StorageLogStructure parameters) throws IOException { writer.append(JsonHandler.unprettyPrint(parameters.getMapParameters())); writer.append(lineSeparator); writer.flush(); } }
StorageLogAppender implements VitamAutoCloseable { public void append(StorageLogStructure parameters) throws IOException { writer.append(JsonHandler.unprettyPrint(parameters.getMapParameters())); writer.append(lineSeparator); writer.flush(); } StorageLogAppender(Path filePath); }
StorageLogAppender implements VitamAutoCloseable { public void append(StorageLogStructure parameters) throws IOException { writer.append(JsonHandler.unprettyPrint(parameters.getMapParameters())); writer.append(lineSeparator); writer.flush(); } StorageLogAppender(Path filePath); void append(StorageLogStructure parameters); @Override void close(); }
StorageLogAppender implements VitamAutoCloseable { public void append(StorageLogStructure parameters) throws IOException { writer.append(JsonHandler.unprettyPrint(parameters.getMapParameters())); writer.append(lineSeparator); writer.flush(); } StorageLogAppender(Path filePath); void append(StorageLogStructure parameters); @Override void close();  }