@Test public void testDelete() throws SQLException, AuthorizeException { bs.delete(); assertTrue("testDelete 0", bs.isDeleted()); }
void delete() throws SQLException { boolean oracle = false; if ("oracle".equals(ConfigurationManager.getProperty("db.name"))) { oracle = true; } log.info(LogManager.getHeader(bContext, "delete_bitstream", "bitstream_id=" + getID())); bContext.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, getID(), String.valueOf(getSequenceID()))); bContext.removeCached(this, getID()); AuthorizeManager.removeAllPolicies(bContext, this); String query = "update bundle set primary_bitstream_id = "; query += (oracle ? "''" : "Null") + " where primary_bitstream_id = ? "; DatabaseManager.updateQuery(bContext, query, bRow.getIntColumn("bitstream_id")); BitstreamStorageManager.delete(bContext, bRow .getIntColumn("bitstream_id")); }
Bitstream extends DSpaceObject { void delete() throws SQLException { boolean oracle = false; if ("oracle".equals(ConfigurationManager.getProperty("db.name"))) { oracle = true; } log.info(LogManager.getHeader(bContext, "delete_bitstream", "bitstream_id=" + getID())); bContext.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, getID(), String.valueOf(getSequenceID()))); bContext.removeCached(this, getID()); AuthorizeManager.removeAllPolicies(bContext, this); String query = "update bundle set primary_bitstream_id = "; query += (oracle ? "''" : "Null") + " where primary_bitstream_id = ? "; DatabaseManager.updateQuery(bContext, query, bRow.getIntColumn("bitstream_id")); BitstreamStorageManager.delete(bContext, bRow .getIntColumn("bitstream_id")); } }
Bitstream extends DSpaceObject { void delete() throws SQLException { boolean oracle = false; if ("oracle".equals(ConfigurationManager.getProperty("db.name"))) { oracle = true; } log.info(LogManager.getHeader(bContext, "delete_bitstream", "bitstream_id=" + getID())); bContext.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, getID(), String.valueOf(getSequenceID()))); bContext.removeCached(this, getID()); AuthorizeManager.removeAllPolicies(bContext, this); String query = "update bundle set primary_bitstream_id = "; query += (oracle ? "''" : "Null") + " where primary_bitstream_id = ? "; DatabaseManager.updateQuery(bContext, query, bRow.getIntColumn("bitstream_id")); BitstreamStorageManager.delete(bContext, bRow .getIntColumn("bitstream_id")); } Bitstream(Context context, TableRow row); }
Bitstream extends DSpaceObject { void delete() throws SQLException { boolean oracle = false; if ("oracle".equals(ConfigurationManager.getProperty("db.name"))) { oracle = true; } log.info(LogManager.getHeader(bContext, "delete_bitstream", "bitstream_id=" + getID())); bContext.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, getID(), String.valueOf(getSequenceID()))); bContext.removeCached(this, getID()); AuthorizeManager.removeAllPolicies(bContext, this); String query = "update bundle set primary_bitstream_id = "; query += (oracle ? "''" : "Null") + " where primary_bitstream_id = ? "; DatabaseManager.updateQuery(bContext, query, bRow.getIntColumn("bitstream_id")); BitstreamStorageManager.delete(bContext, bRow .getIntColumn("bitstream_id")); } Bitstream(Context context, TableRow row); static Bitstream find(Context context, int id); static Bitstream[] findAll(Context context); int getID(); String getHandle(); int getSequenceID(); void setSequenceID(int sid); String getName(); void setName(String n); String getSource(); void setSource(String n); String getDescription(); void setDescription(String n); String getChecksum(); String getChecksumAlgorithm(); long getSize(); void setUserFormatDescription(String desc); String getUserFormatDescription(); String getFormatDescription(); BitstreamFormat getFormat(); void setFormat(BitstreamFormat f); void update(); InputStream retrieve(); Bundle[] getBundles(); int getType(); boolean isRegisteredBitstream(); int getStoreNumber(); DSpaceObject getParentObject(); }
Bitstream extends DSpaceObject { void delete() throws SQLException { boolean oracle = false; if ("oracle".equals(ConfigurationManager.getProperty("db.name"))) { oracle = true; } log.info(LogManager.getHeader(bContext, "delete_bitstream", "bitstream_id=" + getID())); bContext.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, getID(), String.valueOf(getSequenceID()))); bContext.removeCached(this, getID()); AuthorizeManager.removeAllPolicies(bContext, this); String query = "update bundle set primary_bitstream_id = "; query += (oracle ? "''" : "Null") + " where primary_bitstream_id = ? "; DatabaseManager.updateQuery(bContext, query, bRow.getIntColumn("bitstream_id")); BitstreamStorageManager.delete(bContext, bRow .getIntColumn("bitstream_id")); } Bitstream(Context context, TableRow row); static Bitstream find(Context context, int id); static Bitstream[] findAll(Context context); int getID(); String getHandle(); int getSequenceID(); void setSequenceID(int sid); String getName(); void setName(String n); String getSource(); void setSource(String n); String getDescription(); void setDescription(String n); String getChecksum(); String getChecksumAlgorithm(); long getSize(); void setUserFormatDescription(String desc); String getUserFormatDescription(); String getFormatDescription(); BitstreamFormat getFormat(); void setFormat(BitstreamFormat f); void update(); InputStream retrieve(); Bundle[] getBundles(); int getType(); boolean isRegisteredBitstream(); int getStoreNumber(); DSpaceObject getParentObject();  }