takenResourceRegister.get().addReported(video);
propertyReportEvent.fire(new PropertyReportEvent(getVideoEntry(video)));
}
public void onStopRecording(@Observes StopRecordVideo event) throws IOException {
Video video = recorder.get().stopRecording();
takenResourceRegister.get().addTaken(video);
TestResult testResult = event.getVideoMetaData().getTestResult();
if (testResult != null) {
Status status = testResult.getStatus();
appendStatus(video, status);
if (!status.equals(Status.FAILED) && configuration.get().getTakeOnlyOnFail()) {
if (!video.getResource().getAbsoluteFile().delete()) {
System.out.println("video was not deleted: " + video.getResource().getAbsolutePath());
}
File directory = video.getResource().getParentFile();
if (directory != null && directory.listFiles().length == 0) {
FileUtils.deleteDirectory(directory);
}
}
}