|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.content.DSpaceObject
org.dspace.content.Bundle
public class Bundle
Class representing bundles of bitstreams stored in the DSpace system
The corresponding Bitstream objects are loaded into memory. At present, there
is no metadata associated with bundles - they are simple containers. Thus,
the update method doesn't do much yet. Creating, adding or
removing bitstreams has instant effect in the database.
| Method Summary | |
|---|---|
void |
addBitstream(Bitstream b)
Add an existing bitstream to this bundle |
Bitstream |
createBitstream(InputStream is)
Create a new bitstream in this bundle. |
static Bundle |
find(Context context,
int id)
Get a bundle from the database. |
DSpaceObject |
getAdminObject(int action)
Return the dspace object where an ADMIN action right is sufficient to grant the initial authorize check. |
Bitstream |
getBitstreamByName(String name)
|
Bitstream[] |
getBitstreams()
Get the bitstreams in this bundle |
String |
getHandle()
Get the Handle of the object. |
int |
getID()
Get the internal identifier of this bundle |
Item[] |
getItems()
Get the items this bundle appears in |
String |
getName()
Get the name of the bundle |
DSpaceObject |
getParentObject()
Return the dspace object that "own" the current object in the hierarchy. |
int |
getPrimaryBitstreamID()
Get the primary bitstream ID of the bundle |
int |
getType()
return type found in Constants |
void |
inheritCollectionDefaultPolicies(Collection c)
remove all policies on the bundle and its contents, and replace them with the DEFAULT_BITSTREAM_READ policies belonging to the collection. |
Bitstream |
registerBitstream(int assetstore,
String bitstreamPath)
Create a new bitstream in this bundle. |
void |
removeBitstream(Bitstream b)
Remove a bitstream from this bundle - the bitstream is only deleted if this was the last reference to it |
void |
replaceAllBitstreamPolicies(List<ResourcePolicy> newpolicies)
remove all of the policies for the bundle and bitstream contents and replace them with a new list of policies |
void |
setName(String name)
Set the name of the bundle |
void |
setPrimaryBitstreamID(int bitstreamID)
Set the primary bitstream ID of the bundle |
void |
unsetPrimaryBitstreamID()
Unset the primary bitstream ID of the bundle |
void |
update()
Update the bundle metadata |
| Methods inherited from class org.dspace.content.DSpaceObject |
|---|
addDetails, clearDetails, find, getDetails |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Bundle find(Context context,
int id)
throws SQLException
context - DSpace context objectid - ID of the bundle
SQLExceptionpublic int getID()
getID in class DSpaceObjectpublic String getName()
getName in class DSpaceObjectpublic void setName(String name)
name - string name of the bundle (ORIGINAL, TEXT, THUMBNAIL) are the
values currently usedpublic int getPrimaryBitstreamID()
public void setPrimaryBitstreamID(int bitstreamID)
bitstreamID - int ID of primary bitstream (e.g. index html file)public void unsetPrimaryBitstreamID()
public String getHandle()
DSpaceObjectnull
getHandle in class DSpaceObjectnull if it doesn't have
onepublic Bitstream getBitstreamByName(String name)
name - name of the bitstream you're looking for
public Bitstream[] getBitstreams()
public Item[] getItems()
throws SQLException
Item s this bundle appears in
SQLException
public Bitstream createBitstream(InputStream is)
throws AuthorizeException,
IOException,
SQLException
is - the stream to read the new bitstream from
AuthorizeException
IOException
SQLException
public Bitstream registerBitstream(int assetstore,
String bitstreamPath)
throws AuthorizeException,
IOException,
SQLException
assetstore - corresponds to an assetstore in dspace.cfgbitstreamPath - the path and filename relative to the assetstore
IOException
SQLException
AuthorizeException
public void addBitstream(Bitstream b)
throws SQLException,
AuthorizeException
b - the bitstream to add
SQLException
AuthorizeException
public void removeBitstream(Bitstream b)
throws AuthorizeException,
SQLException,
IOException
If the bitstream in question is the primary bitstream recorded for the
bundle the primary bitstream field is unset in order to free the
bitstream from the foreign key constraint so that the
cleanup process can run normally.
b - the bitstream to remove
AuthorizeException
SQLException
IOException
public void update()
throws SQLException,
AuthorizeException
SQLException
AuthorizeExceptionpublic int getType()
getType in class DSpaceObject
public void inheritCollectionDefaultPolicies(Collection c)
throws SQLException,
AuthorizeException
c - Collection
SQLException - if an SQL error or if no default policies found. It's a bit
draconian, but default policies must be enforced.
AuthorizeException
public void replaceAllBitstreamPolicies(List<ResourcePolicy> newpolicies)
throws SQLException,
AuthorizeException
newpolicies - -
this will be all of the new policies for the bundle and
bitstream contents
SQLException
AuthorizeException
public DSpaceObject getAdminObject(int action)
throws SQLException
DSpaceObjectDefault behaviour is ADMIN right on the object grant right on all other action on the object itself. Subclass should override this method as need.
getAdminObject in class DSpaceObjectaction - ID of action being attempted, from
org.dspace.core.Constants. The ADMIN action is
not a valid parameter for this method, an
IllegalArgumentException should be thrown
SQLException
public DSpaceObject getParentObject()
throws SQLException
DSpaceObject
getParentObject in class DSpaceObjectSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||