class DataObjectMerger extends AbstractElementMerger {

    @Override
    public void mergeNodes(List<Node> fromParents, Element toParent, Document toDocument) throws PDUStitchingException {
        final String fileName = getFileName(fromParents, toParent);
        final File file = getFile(fileName, toParent);
        final long size = file.length();
        final Element byteStreamElement = toDocument.createElement("byteStream");
        toParent.appendChild(byteStreamElement);
        byteStreamElement.setAttribute("mimeType", "application/x-netcdf");
        byteStreamElement.setAttribute("size", String.valueOf(size));
        final Element fileLocationElement = toDocument.createElement("fileLocation");
        byteStreamElement.appendChild(fileLocationElement);
        fileLocationElement.setAttribute("locatorType", "URL");
        fileLocationElement.setAttribute("href", fileName);
        final Element checksumElement = toDocument.createElement("checksum");
        byteStreamElement.appendChild(checksumElement);
        checksumElement.setAttribute("checksumName", "MD5");
        final String checksum;
        checksum = getChecksum(file);
        if (checksum.equals("")) {
            throw new PDUStitchingException("Could not create checksum for file " + fileName);
        }
        addTextToNode(checksumElement, checksum, toDocument);
    }

      DataObjectMerger(String fileLocation);

}