bundle.removeBitstream(bitstream);
@Override public void delete(Context context, Bitstream bitstream) throws SQLException, AuthorizeException { // changed to a check on delete // Check authorisation authorizeService.authorizeAction(context, bitstream, Constants.DELETE); log.info(LogManager.getHeader(context, "delete_bitstream", "bitstream_id=" + bitstream.getID())); context.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, bitstream.getID(), String.valueOf(bitstream.getSequenceID()), getIdentifiers(context, bitstream))); // Remove bitstream itself bitstream.setDeleted(true); update(context, bitstream); //Remove our bitstream from all our bundles final List<Bundle> bundles = bitstream.getBundles(); for (Bundle bundle : bundles) { bundle.removeBitstream(bitstream); } //Remove all bundles from the bitstream object, clearing the connection in 2 ways bundles.clear(); // Remove policies only after the bitstream has been updated (otherwise the current user has not WRITE rights) authorizeService.removeAllPolicies(context, bitstream); }
Bitstream bitstream = Bitstream.find(context,bitstreamID); bundle.removeBitstream(bitstream);
bundle.removeBitstream(bitstream); bitstream.getBundles().remove(bundle);
for (int i = 0; i < bundles.length; i++) bundles[i].removeBitstream(bs); bundles[i].update();