port pr 1910

This commit is contained in:
Terry Brady
2018-08-06 11:33:49 -07:00
parent 3eb16056c6
commit 0b33907f5e
2 changed files with 31 additions and 17 deletions

View File

@@ -270,6 +270,26 @@ public class Item extends DSpaceObject implements DSpaceObjectLegacySupport {
return bundles;
}
/**
* Get the bundles matching a bundle name (name corresponds roughly to type)
*
* @param name
* name of bundle (ORIGINAL/TEXT/THUMBNAIL)
*
* @return the bundles in an unordered array
*/
public List<Bundle> getBundles(String name) {
List<Bundle> matchingBundles = new ArrayList<Bundle>();
// now only keep bundles with matching names
List<Bundle> bunds = getBundles();
for (Bundle bundle : bunds) {
if (name.equals(bundle.getName())) {
matchingBundles.add(bundle);
}
}
return matchingBundles;
}
/**
* Add a bundle to the item, should not be made public since we don't want to skip business logic
*
@@ -309,7 +329,6 @@ public class Item extends DSpaceObject implements DSpaceObjectLegacySupport {
if (!this.getID().equals(otherItem.getID())) {
return false;
}
return true;
}