@Override public long getSizeBytes() { return fileDelegate.getSizeBytes(); }
@Override public DataFile fromDcp(Dcp dcp) throws DcpMappingException { DataFile df = super.fromDcp(dcp); if (df == null) { throw new DcpMappingException("Unable to map DataFile from DCP: " + dcp); } DcsFile source = boSearcher.findDataFile(df.getId()); if (source != null) { df.setSource(source.getSource()); df.setSize(source.getSizeBytes()); df.setPath(source.getSource()); } return df; }
/** * 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(); }
metadataFile.setSize(file.getSizeBytes()); metadataFile.setPath(dcs_mf.getPath());
if (file.getSizeBytes() > -1) { writer.startNode(E_SIZE); writer.setValue(String.valueOf(file.getSizeBytes())); writer.endNode();
if (file.getSizeBytes() > -1) { writer.startNode(E_SIZE); writer.setValue(String.valueOf(file.getSizeBytes())); writer.endNode();
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; }