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();
                    }
                } catch (final IOException e) {
                    throw new DataException(e.getMessage());
                }

                openOutputStream.remove(meta.getId());

                // Close child streams.
                for (final String childType : childMap.keySet()) {
                    getChild(childType).close();
                }

                // Only delete the meta if this is the root.
                if (parent == null) {
                    // Set the status of the stream to be deleted.
                    metaService.updateStatus(meta, Status.LOCKED, Status.DELETED);
                }
            } finally {
                deleted = true;
            }
        }
<p>
Open a existing stream source.
</p>

@param streamId  The stream id to open a stream source for.
@param anyStatus Used to specify if this method will return stream sources that
                 are logically deleted or locked. If false only unlocked stream
                 sources will be returned, null otherwise.
@return The loaded stream source if it exists (has not been physically
deleted) else null. Also returns null if one exists but is
logically deleted or locked unless <code>anyStatus</code> is
true.
@throws DataException Could be thrown if no volume
stroom-data/stroom-data-store-mock/src/main/java/stroom/data/store/mock/MockStore.java