mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 06:23:10 +00:00
Fix authentication problem in SwordV2 implementation (DS-3310).
This commit is contained in:
@@ -271,6 +271,31 @@ 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
|
||||
* @param bundle the bundle to be added
|
||||
@@ -298,35 +323,35 @@ public class Item extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
* @return <code>true</code> if object passed in represents the same item
|
||||
* as this object
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
|
||||
if (this.getClass() != objClass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final Item otherItem = (Item) obj;
|
||||
if (!this.getID().equals(otherItem.getID()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
|
||||
if (this.getClass() != objClass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final Item otherItem = (Item) obj;
|
||||
if (!this.getID().equals(otherItem.getID()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 5;
|
||||
hash += 71 * hash + getType();
|
||||
hash += 71 * hash + getID().hashCode();
|
||||
return hash;
|
||||
}
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 5;
|
||||
hash += 71 * hash + getType();
|
||||
hash += 71 * hash + getID().hashCode();
|
||||
return hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* return type found in Constants
|
||||
|
Reference in New Issue
Block a user