@Override public InputStream retrieve(Context context, Bitstream bitstream) throws SQLException, IOException { Integer storeNumber = bitstream.getStoreNumber(); return stores.get(storeNumber).get(bitstream); }
@Override public Map computeChecksum(Context context, Bitstream bitstream) throws IOException { Map wantedMetadata = new HashMap(); wantedMetadata.put("checksum", null); wantedMetadata.put("checksum_algorithm", null); Map receivedMetadata = stores.get(bitstream.getStoreNumber()).about(bitstream, wantedMetadata); return receivedMetadata; }
info.getChecksum()).append("\n"); buf.append(msg("store-number")).append(" = ").append( info.getStoreNumber()).append("\n"); buf.append(msg("description")).append(" = ").append( info.getUserFormatDescription()).append("\n");
out.println("-r -s " + bitstream.getStoreNumber() + " -f " + myName + "\tbundle:" + bundleName +
private void buildFullTextList(Item parentItem) { // now get full text of any bitstreams in the TEXT bundle // trundle through the bundles List<Bundle> myBundles = parentItem.getBundles(); for (Bundle myBundle : emptyIfNull(myBundles)) { if (StringUtils.equals(FULLTEXT_BUNDLE, myBundle.getName())) { // a-ha! grab the text out of the bitstreams List<Bitstream> bitstreams = myBundle.getBitstreams(); for (Bitstream fulltextBitstream : emptyIfNull(bitstreams)) { fullTextStreams.add(new FullTextBitstream(sourceInfo, fulltextBitstream)); log.debug("Added BitStream: " + fulltextBitstream.getStoreNumber() + " " + fulltextBitstream.getSequenceID() + " " + fulltextBitstream.getName()); } } } }
wantedMetadata.put("size_bytes", null); wantedMetadata.put("modified", null); Map receivedMetadata = stores.get(bitstream.getStoreNumber()).about(bitstream, wantedMetadata); stores.get(bitstream.getStoreNumber()).remove(bitstream);
long size = myBitstream.getSizeBytes(); String checksum = myBitstream.getChecksum() + " (" + myBitstream.getChecksumAlgorithm() + ")"; int assetstore = myBitstream.getStoreNumber();
LOG.info(msg("internal-id") + ": " + bitstream.getInternalId()); LOG.info(msg("name") + ": " + bitstream.getName()); LOG.info(msg("store-number") + ": " + bitstream.getStoreNumber()); LOG.info(msg("size") + ": " + bitstream.getSizeBytes()); LOG.info(msg("bitstream-format") + ": " + (bitstream.getFormat(context) != null ? bitstream.getFormat(context)
+ myBitstream.getStoreNumber() + " " + myBitstream.getSequenceID() + " " + myBitstream.getName());
/** * @param context The relevant DSpace Context. * @param bitstream the bitstream to be cloned * @return id of the clone bitstream. * A general class of exceptions produced by failed or interrupted I/O operations. * @throws SQLException An exception that provides information on a database access error or other errors. * @throws AuthorizeException Exception indicating the current user of the context does not have permission * to perform a particular action. */ @Override public Bitstream clone(Context context, Bitstream bitstream) throws SQLException, IOException, AuthorizeException { Bitstream clonedBitstream = bitstreamService.clone(context, bitstream); clonedBitstream.setStoreNumber(bitstream.getStoreNumber()); List<MetadataValue> metadataValues = bitstreamService .getMetadata(bitstream, Item.ANY, Item.ANY, Item.ANY, Item.ANY); for (MetadataValue metadataValue : metadataValues) { bitstreamService.addMetadata(context, clonedBitstream, metadataValue.getMetadataField(), metadataValue.getLanguage(), metadataValue.getValue(), metadataValue.getAuthority(), metadataValue.getConfidence()); } bitstreamService.update(context, clonedBitstream); return clonedBitstream; }