/** * Attempts to resolve the reference {@code ref} by retrieving it from the archive. Specifically the reference * is retrieved, tested for nullity and type, and the resolved reference is returned as a {@code DcsFile}. * * @param ref the reference to a DcsFile entity in the archive * @return the referenced DcsFile * @throws RuntimeException if the reference cannot be resolved, or if the reference resolves to an object other * than a DcsFile instance. */ private DcsFile resolveFileRef(String ref) { DcsFile dataSetMetadataFile; DcsEntity e = archiveUtil.getEntity(ref); if (e == null) { throw new RuntimeException("Package does not conform: missing DataItem Metadata File (reference " + "'" + ref + "' not found in the archive)"); } if (!(e instanceof DcsFile)) { throw new RuntimeException("Package does not conform: missing DataItem Metadata File (reference " + "'" + ref + "' resolved to a " + e.getClass().getName() + ", " + "but expected a " + DcsFile.class.getName() + ")"); } dataSetMetadataFile = (DcsFile) e; return dataSetMetadataFile; }
DcsEntity entity = archiveUtil.getEntity(archive_id); DcsDeliverableUnit root = archiveUtil.determineDepositRoot(dus); return root;
private DcsDeliverableUnit lookup_deliverable_unit(String id) throws DcpMappingException { DcsEntity entity = archiveUtil.getEntity(id); if (entity == null) { throw new DcpMappingException("Unable to lookup du: " + id); } if (!(entity instanceof DcsDeliverableUnit)) { throw new DcpMappingException("Entity is not du: " + entity); } return (DcsDeliverableUnit) entity; }
DcsEntity entity = archiveUtil.getEntity(archive_id); DcsDeliverableUnit root = archiveUtil.determineDepositRoot(dus); return root;
href = href.trim(); if (rel.equals("related")) { DcsEntity e = archiveUtil.getEntity(href); if (e != null) { depositDoc.entities.add(e);
href = href.trim(); if (rel.equals("related")) { DcsEntity e = archiveUtil.getEntity(href); if (e != null) { depositDoc.entities.add(e);
archiveUtil.getEntity(predecessorStateDuId);
entities.add(archiveUtil.getEntity(info.getArchiveId())); } else if (info.getObjectType() == DATA_FILE) { entities = ancestrySearcher.getAncestorsOf(info.getStateId(), true); entities.add(archiveUtil.getEntity(info.getArchiveId())); } else if (info.getObjectType() == COLLECTION) { entities = ancestrySearcher.getAncestorsOf(info.getStateId(), true); } else if (info.getObjectType() == METADATA_FILE) { entities = ancestrySearcher.getAncestorsOf(info.getStateId(), true); entities.add(archiveUtil.getEntity(info.getArchiveId())); } else if (info.getObjectType() == RELATIONSHIP_SET) { entities = ancestrySearcher.getAncestorsOf(info.getStateId(), true);
entities.add(archiveUtil.getEntity(info.getArchiveId())); } else if (info.getObjectType() == DATA_FILE) { entities = ancestrySearcher.getAncestorsOf(info.getStateId(), true); entities.add(archiveUtil.getEntity(info.getArchiveId())); } else if (info.getObjectType() == COLLECTION) { entities = ancestrySearcher.getAncestorsOf(info.getStateId(), true); } else if (info.getObjectType() == METADATA_FILE) { entities = ancestrySearcher.getAncestorsOf(info.getStateId(), true); entities.add(archiveUtil.getEntity(info.getArchiveId())); } else if (info.getObjectType() == RELATIONSHIP_SET) { entities = ancestrySearcher.getAncestorsOf(info.getStateId(), true);
archiveUtil.getEntity(predecessorStateDuId);