[DS-199] SWORD module doesn't accept X-No-Op header (dry run)

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@3825 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Andrea Bollini
2009-05-22 09:53:50 +00:00
parent 8c74ad42b3
commit e03c324b72
2 changed files with 6 additions and 32 deletions

View File

@@ -274,38 +274,11 @@ public class CollectionDepositor extends Depositor
*/
public void undoDeposit(DepositResult result) throws DSpaceSWORDException
{
try
{
SWORDContext sc = swordService.getSwordContext();
SWORDContext sc = swordService.getSwordContext();
// obtain the item's owning collection (there can be only one)
// and ask it to remove the item. Although we're going to abort
// the context, so that this nevers gets written to the db,
// it will get rid of the files on the disk
Item item = result.getItem();
Collection collection = item.getOwningCollection();
collection.removeItem(item);
swordService.message("Removing temporary files from disk");
// abort the context, so no database changes are written
sc.abort();
swordService.message("Database changes aborted");
}
catch (IOException e)
{
log.error("caught exception: ", e);
throw new DSpaceSWORDException(e);
}
catch (AuthorizeException e)
{
log.error("authentication problem; caught exception: ", e);
throw new DSpaceSWORDException(e);
}
catch (SQLException e)
{
log.error("caught exception: ", e);
throw new DSpaceSWORDException(e);
}
// abort the context, so no database changes are written
// uploaded files will be deleted by the cleanup script
sc.abort();
swordService.message("Database changes aborted");
}
}

View File

@@ -26,6 +26,7 @@
(Andrea Bollini)
- [DS-206] Input form visibility restriction doesn't work properly
- [DS-199] SWORD module doesn't accept X-No-Op header (dry run)
1.5.2 final
===========