public class BitstreamResource extends Resource
servletContext
Constructor and Description |
---|
BitstreamResource() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addBitstreamPolicy(Integer bitstreamId,
ResourcePolicy policy,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Add bitstream policy to all bundles containing the bitstream.
|
javax.ws.rs.core.Response |
deleteBitstream(Integer bitstreamId,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Delete bitstream from all bundles in DSpace.
|
javax.ws.rs.core.Response |
deleteBitstreamPolicy(Integer bitstreamId,
Integer policyId,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Delete policy.
|
Bitstream |
getBitstream(Integer bitstreamId,
String expand,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Return bitstream properties without file data.
|
javax.ws.rs.core.Response |
getBitstreamData(Integer bitstreamId,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Read bitstream data.
|
ResourcePolicy[] |
getBitstreamPolicies(Integer bitstreamId,
javax.ws.rs.core.HttpHeaders headers)
Return all bitstream resource policies from all bundles, in which
the bitstream is present.
|
Bitstream[] |
getBitstreams(String expand,
Integer limit,
Integer offset,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Read list of bitstreams.
|
javax.ws.rs.core.Response |
updateBitstream(Integer bitstreamId,
Bitstream bitstream,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Update bitstream metadata.
|
javax.ws.rs.core.Response |
updateBitstreamData(Integer bitstreamId,
InputStream is,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Update bitstream data.
|
createContext, getActionString, getServletContextPath, getToken, getUser, mySplit, processException, processFinally, writeStats
public Bitstream getBitstream(Integer bitstreamId, String expand, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
bitstreamId
- Id of bitstream in DSpace.expand
- This string defines which additional optional fields will be added
to bitstream response. Individual options are separated by commas without
spaces. The options are: "all", "parent".headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.javax.ws.rs.WebApplicationException
- It can happen on: Bad request, unauthorized, SQL exception
and context exception(could not create context).public ResourcePolicy[] getBitstreamPolicies(Integer bitstreamId, @Context javax.ws.rs.core.HttpHeaders headers)
bitstreamId
- Id of bitstream in DSpace.headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.public Bitstream[] getBitstreams(String expand, Integer limit, Integer offset, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
limit
- How many bitstreams will be in the list. Default value is 100.offset
- On which offset (item) the list starts. Default value is 0.headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.javax.ws.rs.WebApplicationException
- Thrown in case of a problem with reading the database or with
creating a context.public javax.ws.rs.core.Response getBitstreamData(Integer bitstreamId, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
bitstreamId
- Id of the bitstream, whose data will be read.headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.javax.ws.rs.WebApplicationException
- Thrown if there was a problem: reading the file data; or reading
the database; or creating the context; or with authorization.public javax.ws.rs.core.Response addBitstreamPolicy(Integer bitstreamId, ResourcePolicy policy, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
bitstreamId
- Id of bitstream in DSpace.policy
- Policy to be added. The following attributes are not
applied: epersonId,headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response updateBitstream(Integer bitstreamId, Bitstream bitstream, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
bitstreamId
- Id of bistream to be updated.bitstream
- Bitstream with will be placed. It must have filled user
credentials.headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.javax.ws.rs.WebApplicationException
- Thrown when: Error reading from database; or error
creating context; or error regarding bitstream authorization.public javax.ws.rs.core.Response updateBitstreamData(Integer bitstreamId, InputStream is, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
bitstreamId
- Id of bistream to be updated.is
- InputStream filled with new data.headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.javax.ws.rs.WebApplicationException
- This exception can be thrown in this cases: Problem with
reading or writing to database. Or problem with reading from
InputStream.public javax.ws.rs.core.Response deleteBitstream(Integer bitstreamId, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
bitstreamId
- Id of bitstream to be deleted.headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.javax.ws.rs.WebApplicationException
- Can be thron if there was a problem reading or editting
the database. Or problem deleting the file. Or problem with
authorization to bitstream and bundles. Or problem with
creating context.public javax.ws.rs.core.Response deleteBitstreamPolicy(Integer bitstreamId, Integer policyId, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
bitstreamId
- Id of the DSpace bitstream whose policy will be deleted.policyId
- Id of the policy to delete.headers
- If you want to access the item as the user logged into the context.
The header "rest-dspace-token" with the token passed
from the login method must be set.javax.ws.rs.WebApplicationException
Copyright © 2015 DuraSpace. All Rights Reserved.