mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 04:53:16 +00:00
[DS-643] New testing framework (GSoC 2010)
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5252 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -584,6 +584,33 @@ public class Bitstream extends DSpaceObject
|
||||
.getIntColumn("bitstream_id"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Bitstreams are only logically deleted (via a flag in the database).
|
||||
* This method allows us to verify is the bitstream is still valid
|
||||
*
|
||||
* @return true if the bitstream has been deleted
|
||||
*/
|
||||
boolean isDeleted() throws SQLException
|
||||
{
|
||||
String query = "select count(*) as mycount from Bitstream where deleted = '1' and bitstream_id = ? ";
|
||||
TableRowIterator tri = DatabaseManager.query(bContext, query, bRow.getIntColumn("bitstream_id"));
|
||||
long count = 0;
|
||||
|
||||
try
|
||||
{
|
||||
TableRow r = tri.next();
|
||||
count = r.getLongColumn("mycount");
|
||||
}
|
||||
finally
|
||||
{
|
||||
// close the TableRowIterator to free up resources
|
||||
if (tri != null)
|
||||
tri.close();
|
||||
}
|
||||
|
||||
return count == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the contents of the bitstream
|
||||
*
|
||||
|
Reference in New Issue
Block a user