@Override public String getBitstreamProvenanceMessage(Context context, Item myitem) throws SQLException { // Get non-internal format bitstreams List<Bitstream> bitstreams = itemService.getNonInternalBitstreams(context, myitem); // Create provenance description StringBuilder myMessage = new StringBuilder(); myMessage.append("No. of bitstreams: ").append(bitstreams.size()).append("\n"); // Add sizes and checksums of bitstreams for (Bitstream bitstream : bitstreams) { myMessage.append(bitstream.getName()).append(": ") .append(bitstream.getSizeBytes()).append(" bytes, checksum: ") .append(bitstream.getChecksum()).append(" (") .append(bitstream.getChecksumAlgorithm()).append(")\n"); } return myMessage.toString(); } }
private MediaResource getBitstreamResource(Context context, Bitstream bitstream) throws SwordServerException, SwordAuthException { try { InputStream stream = bitstreamService.retrieve(context, bitstream); MediaResource mr = new MediaResource(stream, bitstream.getFormat(context).getMIMEType(), null, true); mr.setContentMD5(bitstream.getChecksum()); mr.setLastModified(this.getLastModified(context, bitstream)); return mr; } catch (IOException | SQLException e) { throw new SwordServerException(e); } catch (AuthorizeException e) { throw new SwordAuthException(e); } }
.append("\n"); buf.append(msg("checksum")).append(" = ").append( info.getChecksum()).append("\n"); buf.append(msg("store-number")).append(" = ").append( info.getStoreNumber()).append("\n");
/** * Add the bitstream metadata to the item * * @param item The item * @param bitstream The bitstream * @param type The type of bitstream * @throws SQLException An exception that provides information on a database access error or other errors. */ protected void addMetadata(Item item, Bitstream bitstream, String type) throws SQLException { String value = bitstream.getFormat(Curator.curationContext()).getMIMEType() + "##"; value += bitstream.getName() + "##"; value += bitstream.getSizeBytes() + "##"; value += item.getHandle() + "##"; value += bitstream.getSequenceID() + "##"; value += bitstream.getChecksum() + "##"; if (bitstream.getDescription() != null) { value += bitstream.getDescription(); } itemService.addMetadata(Curator.curationContext(), item, "dc", "format", type, "en", value); } }
String cks = bitstream.getChecksum(); String cka = bitstream.getChecksumAlgorithm(); if (cks != null && cka != null) {
String md = fixity.getChildTextTrim("messageDigest", PREMIS_NS); String b_alg = bitstream.getChecksumAlgorithm(); String b_md = bitstream.getChecksum(); if (StringUtils.equals(alg, b_alg)) { if (StringUtils.equals(md, b_md)) {
validityKey.append(bitstream.getSource()); validityKey.append(bitstream.getDescription()); validityKey.append(bitstream.getChecksum()); validityKey.append(bitstream.getChecksumAlgorithm()); validityKey.append(bitstream.getSize());
List<Bundle> bundles = myBitstream.getBundles(); long size = myBitstream.getSizeBytes(); String checksum = myBitstream.getChecksum() + " (" + myBitstream.getChecksumAlgorithm() + ")"; int assetstore = myBitstream.getStoreNumber();
if (bitstream.getChecksum() == null) { mostRecentChecksum.setCurrentChecksum(""); mostRecentChecksum.setExpectedChecksum(""); } else { mostRecentChecksum.setCurrentChecksum(bitstream.getChecksum()); mostRecentChecksum.setExpectedChecksum(bitstream.getChecksum());
CheckSum checkSum = new CheckSum(); checkSum.setCheckSumAlgorith(bitstream.getChecksumAlgorithm()); checkSum.setValue(bitstream.getChecksum()); this.setCheckSum(checkSum);
@Override public Bitstream clone(Context context, Bitstream bitstream) throws SQLException { // Create a new bitstream with a new ID. Bitstream clonedBitstream = bitstreamDAO.create(context, new Bitstream()); // Set the internal identifier, file size, checksum, and // checksum algorithm as same as the given bitstream. clonedBitstream.setInternalId(bitstream.getInternalId()); clonedBitstream.setSizeBytes(bitstream.getSizeBytes()); clonedBitstream.setChecksum(bitstream.getChecksum()); clonedBitstream.setChecksumAlgorithm(bitstream.getChecksumAlgorithm()); clonedBitstream.setFormat(bitstream.getBitstreamFormat()); try { //Update our bitstream but turn off the authorization system since permissions //haven't been set at this point in time. context.turnOffAuthorisationSystem(); update(context, clonedBitstream); } catch (AuthorizeException e) { log.error(e); //Can never happen since we turn off authorization before we update } finally { context.restoreAuthSystemState(); } return clonedBitstream; }
this.makeUKDCTermsElement("checksum", bitstreams[k].getChecksumAlgorithm(), bitstreams[k].getChecksum(), metadata);
String cs = logoBs.getChecksum(); if (cs != null && csType != null) { try {
String cks = bit.getChecksum(); String cka = bit.getChecksumAlgorithm(); String oname = bit.getSource();
String cs = bitstream.getChecksum(); if (auth && cs != null && csType != null) { try {
String checksum = bitstream.getChecksum(); long size = bitstream.getSize();
String desc = bitstream.getDescription(); String algorithm = bitstream.getChecksumAlgorithm(); String checksum = bitstream.getChecksum();