class ClearingReportGenerator {

    Path createClearingDocument(SW360Release release, Path targetDir) {
        Path clearingDocument = targetDir.resolve(release.getId() + CLEARING_DOC_SUFFIX);
        try {
            Files.createDirectories(targetDir);
            ObjectMapper mapper = new ObjectMapper();
            mapper.writeValue(Files.newBufferedWriter(clearingDocument), release);
            return clearingDocument;
        } catch (IOException e) {
            throw new SW360ClientException("Could not create clearing document " + clearingDocument.toString(), e);
        }
    }

}