Skip to content

Commit

Permalink
94299 Multiple Bitstream deletion endpoint: rename items to parents
Browse files Browse the repository at this point in the history
  • Loading branch information
JensRoets-Atmire committed Sep 14, 2022
1 parent 51d8874 commit 4644655
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -161,7 +161,7 @@ protected void deleteList(Context context, List<DSpaceObject> dsoList)
throw new UnprocessableEntityException("Not all given items are bitstreams.");
}
// check that they're all part of the same Item
List<DSpaceObject> items = new ArrayList<>();
List<DSpaceObject> parents = new ArrayList<>();
for (DSpaceObject dso : dsoList) {
Bitstream bit = bs.find(context, dso.getID());
DSpaceObject bitstreamParent = bs.getParentObject(context, bit);
Expand All @@ -173,10 +173,10 @@ protected void deleteList(Context context, List<DSpaceObject> dsoList)
throw new UnprocessableEntityException("The bitstream with uuid " + bit.getID()
+ " was already deleted");
} else {
items.add(bitstreamParent);
parents.add(bitstreamParent);
}
}
if (items.stream().distinct().count() > 1) {
if (parents.stream().distinct().count() > 1) {
throw new UnprocessableEntityException("Not all given items are part of the same Item.");
}
// delete all Bitstreams
Expand Down

0 comments on commit 4644655

Please sign in to comment.