@Test public void shouldNotDeleteAnyByDefault() throws Exception { String[] files = resultsDirectory.list(); new RemoveAttachmentsEvent("a^").process(root); for (String file : files) { assertThat(resultsDirectory, contains(file)); } checkAttachmentsCount(root, 1); }
@Override public void process(Step context) { Iterator<Attachment> iterator = context.getAttachments().listIterator(); while (iterator.hasNext()) { Attachment attachment = iterator.next(); if (pattern.matcher(attachment.getSource()).matches()) { deleteAttachment(attachment); iterator.remove(); } } for (Step step : context.getSteps()) { process(step); } }
RemoveAttachmentsEvent extends AbstractRemoveAttachmentEvent { @Override public void process(Step context) { Iterator<Attachment> iterator = context.getAttachments().listIterator(); while (iterator.hasNext()) { Attachment attachment = iterator.next(); if (pattern.matcher(attachment.getSource()).matches()) { deleteAttachment(attachment); iterator.remove(); } } for (Step step : context.getSteps()) { process(step); } } }
RemoveAttachmentsEvent extends AbstractRemoveAttachmentEvent { @Override public void process(Step context) { Iterator<Attachment> iterator = context.getAttachments().listIterator(); while (iterator.hasNext()) { Attachment attachment = iterator.next(); if (pattern.matcher(attachment.getSource()).matches()) { deleteAttachment(attachment); iterator.remove(); } } for (Step step : context.getSteps()) { process(step); } } RemoveAttachmentsEvent(String regex); }
RemoveAttachmentsEvent extends AbstractRemoveAttachmentEvent { @Override public void process(Step context) { Iterator<Attachment> iterator = context.getAttachments().listIterator(); while (iterator.hasNext()) { Attachment attachment = iterator.next(); if (pattern.matcher(attachment.getSource()).matches()) { deleteAttachment(attachment); iterator.remove(); } } for (Step step : context.getSteps()) { process(step); } } RemoveAttachmentsEvent(String regex); @Override void process(Step context); }
RemoveAttachmentsEvent extends AbstractRemoveAttachmentEvent { @Override public void process(Step context) { Iterator<Attachment> iterator = context.getAttachments().listIterator(); while (iterator.hasNext()) { Attachment attachment = iterator.next(); if (pattern.matcher(attachment.getSource()).matches()) { deleteAttachment(attachment); iterator.remove(); } } for (Step step : context.getSteps()) { process(step); } } RemoveAttachmentsEvent(String regex); @Override void process(Step context);  }