@Test public void testSuccesfullyUploadAndCleanup() { testSuccessfullyUpload(); uploadedDocumentService.removeContent(DOC_ID); File file = storage.getRootFolder().resolve(DOC_ID).resolve(DOC_NAME).toFile(); Assertions.assertThat(file) .isNotNull() .doesNotExist(); }
@Override public void removeContent(String id) { DocumentUploadSession session = uploadSessions.remove(id); if (session != null) { session.setState(DocumentUploadSession.State.ABORTED); storage.removeContent(id); } else { storage.removeContent(id); } }
UploadedDocumentServiceImpl implements UploadedDocumentService,
                                                    Serializable { @Override public void removeContent(String id) { DocumentUploadSession session = uploadSessions.remove(id); if (session != null) { session.setState(DocumentUploadSession.State.ABORTED); storage.removeContent(id); } else { storage.removeContent(id); } } }
UploadedDocumentServiceImpl implements UploadedDocumentService,
                                                    Serializable { @Override public void removeContent(String id) { DocumentUploadSession session = uploadSessions.remove(id); if (session != null) { session.setState(DocumentUploadSession.State.ABORTED); storage.removeContent(id); } else { storage.removeContent(id); } } @Inject  UploadedDocumentServiceImpl(UploadedDocumentStorage storage); }
UploadedDocumentServiceImpl implements UploadedDocumentService,
                                                    Serializable { @Override public void removeContent(String id) { DocumentUploadSession session = uploadSessions.remove(id); if (session != null) { session.setState(DocumentUploadSession.State.ABORTED); storage.removeContent(id); } else { storage.removeContent(id); } } @Inject  UploadedDocumentServiceImpl(UploadedDocumentStorage storage); @Override DocumentUploadResponse uploadContent(final DocumentUploadChunk chunk); @Override void removeContent(String id); @PreDestroy void clear(); }
UploadedDocumentServiceImpl implements UploadedDocumentService,
                                                    Serializable { @Override public void removeContent(String id) { DocumentUploadSession session = uploadSessions.remove(id); if (session != null) { session.setState(DocumentUploadSession.State.ABORTED); storage.removeContent(id); } else { storage.removeContent(id); } } @Inject  UploadedDocumentServiceImpl(UploadedDocumentStorage storage); @Override DocumentUploadResponse uploadContent(final DocumentUploadChunk chunk); @Override void removeContent(String id); @PreDestroy void clear();  }