@Override
    public void close() throws IOException {
        closed = true;

        try {
            streamCloser.close();
        } finally {
            super.close();

            if (outputStream != null) {
                Files.move(lockFile, finalFile);
                outputStream = null;
            }
        }
    }
Output stream that writes a lock file with the data and then renames to the
final file once closed.
<p>
If lazy is set on it also does not create the file until some data is written
(thus the file does not exist if no data was written).
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/LockingFileOutputStream.java