@Test public void commit_ADDED_FILES() throws IOException { ContentFileTransactionContext context = new ContentFileTransactionContext(contentDir, deletedTmpDir); context.addAddedFile("file1.txt"); context.addAddedFile("file2.txt"); File file1 = createFile(contentDir, "file1.txt", "content1"); File file2 = createFile(contentDir, "file2.txt", "content2"); contentFileCommitRollbackService.commit(context); assertFile(file1, "content1"); assertFile(file2, "content2"); assertFalse(deletedTmpDir.exists()); }
public void commit(ContentFileTransactionContext context) throws IOException { Preconditions.checkNotNull(context); File deletedTmpDirectory = context.getDeletedTmpDirectory(); FileUtils.deleteDirectory(deletedTmpDirectory); }
ContentFileCommitRollbackService { public void commit(ContentFileTransactionContext context) throws IOException { Preconditions.checkNotNull(context); File deletedTmpDirectory = context.getDeletedTmpDirectory(); FileUtils.deleteDirectory(deletedTmpDirectory); } }
ContentFileCommitRollbackService { public void commit(ContentFileTransactionContext context) throws IOException { Preconditions.checkNotNull(context); File deletedTmpDirectory = context.getDeletedTmpDirectory(); FileUtils.deleteDirectory(deletedTmpDirectory); }  }
ContentFileCommitRollbackService { public void commit(ContentFileTransactionContext context) throws IOException { Preconditions.checkNotNull(context); File deletedTmpDirectory = context.getDeletedTmpDirectory(); FileUtils.deleteDirectory(deletedTmpDirectory); }  void commit(ContentFileTransactionContext context); void rollback(ContentFileTransactionContext context); }
ContentFileCommitRollbackService { public void commit(ContentFileTransactionContext context) throws IOException { Preconditions.checkNotNull(context); File deletedTmpDirectory = context.getDeletedTmpDirectory(); FileUtils.deleteDirectory(deletedTmpDirectory); }  void commit(ContentFileTransactionContext context); void rollback(ContentFileTransactionContext context);  }