mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 11:33:11 +00:00
port pr 1910
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user