@Test public void cleanupDrain() throws Exception { File file = folder.newFile("file"); ProcessScript<StringBuilder> process = process("testing", dummy(), driver(file.getName())); FileResourceManipulator manipulator = new FileResourceManipulator(profile(), new ParameterList()); assertThat(file.exists(), is(true)); manipulator.cleanupDrain(process); assertThat(file.exists(), is(false)); manipulator.cleanupDrain(process); }
@Override public void cleanupDrain(ProcessScript<?> script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } File path = FileResourceUtil.getPath(profile, script, arguments, DriverScript.Kind.DRAIN); delete(path); }
FileResourceManipulator extends ResourceManipulator { @Override public void cleanupDrain(ProcessScript<?> script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } File path = FileResourceUtil.getPath(profile, script, arguments, DriverScript.Kind.DRAIN); delete(path); } }
FileResourceManipulator extends ResourceManipulator { @Override public void cleanupDrain(ProcessScript<?> script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } File path = FileResourceUtil.getPath(profile, script, arguments, DriverScript.Kind.DRAIN); delete(path); } FileResourceManipulator(FileProfile profile, ParameterList arguments); }
FileResourceManipulator extends ResourceManipulator { @Override public void cleanupDrain(ProcessScript<?> script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } File path = FileResourceUtil.getPath(profile, script, arguments, DriverScript.Kind.DRAIN); delete(path); } FileResourceManipulator(FileProfile profile, ParameterList arguments); @Override String getName(); @Override void cleanupSource(ProcessScript<?> script); @Override void cleanupDrain(ProcessScript<?> script); @Override SourceDriver<T> createSourceForSource(ProcessScript<T> script); @Override DrainDriver<T> createDrainForSource(ProcessScript<T> script); @Override SourceDriver<T> createSourceForDrain(ProcessScript<T> script); @Override DrainDriver<T> createDrainForDrain(ProcessScript<T> script); }
FileResourceManipulator extends ResourceManipulator { @Override public void cleanupDrain(ProcessScript<?> script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } File path = FileResourceUtil.getPath(profile, script, arguments, DriverScript.Kind.DRAIN); delete(path); } FileResourceManipulator(FileProfile profile, ParameterList arguments); @Override String getName(); @Override void cleanupSource(ProcessScript<?> script); @Override void cleanupDrain(ProcessScript<?> script); @Override SourceDriver<T> createSourceForSource(ProcessScript<T> script); @Override DrainDriver<T> createDrainForSource(ProcessScript<T> script); @Override SourceDriver<T> createSourceForDrain(ProcessScript<T> script); @Override DrainDriver<T> createDrainForDrain(ProcessScript<T> script);  }