mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[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:
@@ -274,38 +274,11 @@ public class CollectionDepositor extends Depositor
|
|||||||
*/
|
*/
|
||||||
public void undoDeposit(DepositResult result) throws DSpaceSWORDException
|
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)
|
// abort the context, so no database changes are written
|
||||||
// and ask it to remove the item. Although we're going to abort
|
// uploaded files will be deleted by the cleanup script
|
||||||
// the context, so that this nevers gets written to the db,
|
sc.abort();
|
||||||
// it will get rid of the files on the disk
|
swordService.message("Database changes aborted");
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
(Andrea Bollini)
|
(Andrea Bollini)
|
||||||
- [DS-206] Input form visibility restriction doesn't work properly
|
- [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
|
1.5.2 final
|
||||||
===========
|
===========
|
||||||
|
Reference in New Issue
Block a user