public void delete() {
        if (deleted) {
            throw new DataException("Target already deleted");
        }
        if (closed) {
            throw new DataException("Target already closed");
        }

        try {
            // Close the stream target.
            try {
                if (outputStream != null) {
                    outputStream.close();
                }

                // Close off any open kids .... closing the parent
                // closes kids (the caller can also close the kid off if they like).
                childMap.forEach((k, v) -> v.close());
                childMap.clear();
            } catch (final IOException e) {
                LOGGER.error(() -> "closeStreamTarget() - Error on closing stream " + this, e);
            }

            // Only delete the root target.
            if (parent == null) {
                // Mark the target meta as deleted.
                this.meta = metaService.updateStatus(meta, Status.LOCKED, Status.DELETED);
            }
        } finally {
            deleted = true;
        }
    }
Creates a new file system stream target.

@return A new file system target.
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/FsTarget.java