@Override public String getName() { return fileDelegate.getName(); }
/** * Finds the first DcsFile in the supplied DCP that has a {@link DcsFile#getName() name} matching {@code name}; * otherwise {@code null} is returned. * * @param dcp the DCP * @param name the name of the file to retrieve * @return the first matching DcsFile, or {@code null} */ public DcsFile findDcsFile(Dcp dcp, String name) { for (DcsFile f : dcp.getFiles()) { if (f.getName().equals(name)) { return f; } } return null; }
/** * Finds the first DcsFile in the supplied DCP that has a {@link DcsFile#getName() name} matching {@code name}; * otherwise {@code null} is returned. * * @param dcp the DCP * @param name the name of the file to retrieve * @return the first matching DcsFile, or {@code null} */ public DcsFile findDcsFile(Dcp dcp, String name) { for (DcsFile f : dcp.getFiles()) { if (f.getName().equals(name)) { return f; } } return null; }
for (DcsManifestationFile mf : man.getManifestationFiles()) { if (mf.getRef().getRef().equals(candidateFile.getId()) && candidateFile.getName().equals("schema-source")) { file = candidateFile;
for (DcsManifestationFile mf : man.getManifestationFiles()) { if (mf.getRef().getRef().equals(candidateFile.getId()) && candidateFile.getName().equals("schema-source")) { file = candidateFile;
/** * Copy constructor for a DcsFile. The state of <code>toCopy</code> is copied * to this. * * @param toCopy the dcs file to copy */ public DcsFile(DcsFile toCopy) { super(toCopy); this.name = toCopy.getName(); this.extant = toCopy.isExtant(); this.sizeBytes = toCopy.getSizeBytes(); this.fixity = toCopy.getFixity(); this.formats = toCopy.getFormats(); this.source = toCopy.getSource(); this.valid = toCopy.getValid(); this.metadata = toCopy.getMetadata(); this.metadataRef = toCopy.getMetadataRef(); }
dataSetMdMetadataManFile.setPath("/" + dataSetMd.getName()); dataSetMdMetadataManFile.setRef(new DcsFileRef(dataSetMd.getId())); final DcsManifestation dataSetMdManifestation = new DcsManifestation();
dcfdsv.setVersionID(dcfds.getId() + DatastreamVersionConverter.BASE_VERSION); dcfdsv.setLabel(entity.getName());
private static SolrInputDocument toSolr(DcsFile file, ArchiveStore store) throws IOException { SolrInputDocument doc = new SolrInputDocument(); add(doc, EntityField.ID, file.getId()); add(doc, EntityField.TYPE, EntityTypeValue.FILE.solrValue()); add(doc, FileField.NAME, file.getName()); add(doc, FileField.SOURCE, file.getSource()); add(doc, FileField.SIZE, file.getSizeBytes()); if (file.getValid() != null) { doc.addField(FileField.VALID.solrName(), file.getValid()); } doc.addField(FileField.EXTANT.solrName(), file.isExtant()); addFixitySet(doc, file.getFixity()); addFormatSet(doc, file.getFormats()); addResourceIdentifierSet(doc, file.getAlternateIds()); addMetadataSet(doc, file.getMetadata()); addMetadataRefSet(doc, file.getMetadataRef(), EntityField.METADATA_REF, store); return doc; }