class FileSystemPreparationRepository extends ObjectPreparationRepository {

    @Override
    public void add(Identifiable object) {

        // defensive programming
        if (object == null) {
            LOG.warn("cannot save null...");
            return;
        }

        final File outputFile = getIdentifiableFile(object);
        try {
            FileUtils.touch(outputFile);
        } catch (IOException e) {
            LOG.error("Unable to prepare file for {}.", object, e);
        }

        try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(outputFile))) {
            mapper.writer().writeValue(output, object);
        } catch (IOException e) {
            LOG.error("Error saving {}", object, e);
            throw new TDPException(CommonErrorCodes.UNABLE_TO_SAVE_PREPARATION, e,
                    ExceptionContext.build().put("id", object.id()));
        }
        LOG.debug("{} #{} saved", object.getClass().getSimpleName(), object.id());
    }

}