@Path(value="/bitstreams") public class BitstreamResource extends Resource
| Modifier and Type | Field and Description |
|---|---|
protected AuthorizeService |
authorizeService |
protected BitstreamFormatService |
bitstreamFormatService |
protected BitstreamService |
bitstreamService |
protected BitstreamStorageService |
bitstreamStorageService |
protected BundleService |
bundleService |
protected GroupService |
groupService |
protected ResourcePolicyService |
resourcePolicyService |
servletContext| Constructor and Description |
|---|
BitstreamResource() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
addBitstreamPolicy(String 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(String 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(String 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(String 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(String 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(String 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(String 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(String 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, mySplit, processException, processFinally, writeStatsprotected BitstreamService bitstreamService
protected BundleService bundleService
protected AuthorizeService authorizeService
protected BitstreamFormatService bitstreamFormatService
protected BitstreamStorageService bitstreamStorageService
protected ResourcePolicyService resourcePolicyService
protected GroupService groupService
@GET
@Path(value="/{bitstream_id}")
@Produces(value={"application/json","application/xml"})
public Bitstream getBitstream(@PathParam(value="bitstream_id")
String bitstreamId,
@QueryParam(value="expand")
String expand,
@QueryParam(value="userIP")
String user_ip,
@QueryParam(value="userAgent")
String user_agent,
@QueryParam(value="xforwardedfor")
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".user_ip - User's IP address.user_agent - User agent string (specifies browser used and its version).xforwardedfor - When accessed via a reverse proxy, the application sees the proxy's IP as the
source of the request. The proxy may be configured to add the
"X-Forwarded-For" HTTP header containing the original IP of the client
so that the reverse-proxied application can get the client's IP.headers - If you want to access the item as the user logged into the
context. The value of the "rest-dspace-token" header must be set
to the token received from the login method response.request - Servlet's HTTP request object.javax.ws.rs.WebApplicationException - It can happen on: Bad request, unauthorized, SQL exception
and context exception(could not create context).@GET
@Path(value="/{bitstream_id}/policy")
@Produces(value={"application/json","application/xml"})
public ResourcePolicy[] getBitstreamPolicies(@PathParam(value="bitstream_id")
String 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.@GET
@Produces(value={"application/json","application/xml"})
public Bitstream[] getBitstreams(@QueryParam(value="expand")
String expand,
@QueryParam(value="limit") @DefaultValue(value="100")
Integer limit,
@QueryParam(value="offset") @DefaultValue(value="0")
Integer offset,
@QueryParam(value="userIP")
String user_ip,
@QueryParam(value="userAgent")
String user_agent,
@QueryParam(value="xforwardedfor")
String xforwardedfor,
@Context
javax.ws.rs.core.HttpHeaders headers,
@Context
javax.servlet.http.HttpServletRequest request)
throws javax.ws.rs.WebApplicationException
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".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.user_ip - User's IP address.user_agent - User agent string (specifies browser used and its version).xforwardedfor - When accessed via a reverse proxy, the application sees the proxy's IP as the
source of the request. The proxy may be configured to add the
"X-Forwarded-For" HTTP header containing the original IP of the client
so that the reverse-proxied application can get the client's IP.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.request - Servlet's HTTP request object.javax.ws.rs.WebApplicationException - Thrown in case of a problem with reading the database or with
creating a context.@GET
@Path(value="/{bitstream_id}/retrieve")
public javax.ws.rs.core.Response getBitstreamData(@PathParam(value="bitstream_id")
String bitstreamId,
@QueryParam(value="userIP")
String user_ip,
@QueryParam(value="userAgent")
String user_agent,
@QueryParam(value="xforwardedfor")
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.user_ip - User's IP address.user_agent - User agent string (specifies browser used and its version).xforwardedfor - When accessed via a reverse proxy, the application sees the proxy's IP as the
source of the request. The proxy may be configured to add the
"X-Forwarded-For" HTTP header containing the original IP of the client
so that the reverse-proxied application can get the client's IP.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.request - Servlet's HTTP request object.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.@POST
@Path(value="/{bitstream_id}/policy")
@Consumes(value={"application/json","application/xml"})
public javax.ws.rs.core.Response addBitstreamPolicy(@PathParam(value="bitstream_id")
String bitstreamId,
ResourcePolicy policy,
@QueryParam(value="userIP")
String user_ip,
@QueryParam(value="userAgent")
String user_agent,
@QueryParam(value="xforwardedfor")
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,user_ip - User's IP address.user_agent - User agent string (specifies browser used and its version).xforwardedfor - When accessed via a reverse proxy, the application sees the proxy's IP as the
source of the request. The proxy may be configured to add the
"X-Forwarded-For" HTTP header containing the original IP of the client
so that the reverse-proxied application can get the client's IP.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.request - Servlet's HTTP request object.javax.ws.rs.WebApplicationException@PUT
@Path(value="/{bitstream_id}")
@Consumes(value={"application/json","application/xml"})
public javax.ws.rs.core.Response updateBitstream(@PathParam(value="bitstream_id")
String bitstreamId,
Bitstream bitstream,
@QueryParam(value="userIP")
String user_ip,
@QueryParam(value="userAgent")
String user_agent,
@QueryParam(value="xforwardedfor")
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.user_ip - User's IP address.user_agent - User agent string (specifies browser used and its version).xforwardedfor - When accessed via a reverse proxy, the application sees the proxy's IP as the
source of the request. The proxy may be configured to add the
"X-Forwarded-For" HTTP header containing the original IP of the client
so that the reverse-proxied application can get the client's IP.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.request - Servlet's HTTP request object.javax.ws.rs.WebApplicationException - Thrown when: Error reading from database; or error
creating context; or error regarding bitstream authorization.@PUT
@Path(value="/{bitstream_id}/data")
public javax.ws.rs.core.Response updateBitstreamData(@PathParam(value="bitstream_id")
String bitstreamId,
InputStream is,
@QueryParam(value="userIP")
String user_ip,
@QueryParam(value="userAgent")
String user_agent,
@QueryParam(value="xforwardedfor")
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.user_ip - User's IP address.user_agent - User agent string (specifies browser used and its version).xforwardedfor - When accessed via a reverse proxy, the application sees the proxy's IP as the
source of the request. The proxy may be configured to add the
"X-Forwarded-For" HTTP header containing the original IP of the client
so that the reverse-proxied application can get the client's IP.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.request - Servlet's HTTP request object.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.@DELETE
@Path(value="/{bitstream_id}")
public javax.ws.rs.core.Response deleteBitstream(@PathParam(value="bitstream_id")
String bitstreamId,
@QueryParam(value="userIP")
String user_ip,
@QueryParam(value="userAgent")
String user_agent,
@QueryParam(value="xforwardedfor")
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.user_ip - User's IP address.user_agent - User agent string (specifies browser used and its version).xforwardedfor - When accessed via a reverse proxy, the application sees the proxy's IP as the
source of the request. The proxy may be configured to add the
"X-Forwarded-For" HTTP header containing the original IP of the client
so that the reverse-proxied application can get the client's IP.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.request - Servlet's HTTP request object.javax.ws.rs.WebApplicationException - Can be thrown if there was a problem reading or editing
the database. Or problem deleting the file. Or problem with
authorization to bitstream and bundles. Or problem with
creating context.@DELETE
@Path(value="/{bitstream_id}/policy/{policy_id}")
public javax.ws.rs.core.Response deleteBitstreamPolicy(@PathParam(value="bitstream_id")
String bitstreamId,
@PathParam(value="policy_id")
Integer policyId,
@QueryParam(value="userIP")
String user_ip,
@QueryParam(value="userAgent")
String user_agent,
@QueryParam(value="xforwardedfor")
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.user_ip - User's IP address.user_agent - User agent string (specifies browser used and its version).xforwardedfor - When accessed via a reverse proxy, the application sees the proxy's IP as the
source of the request. The proxy may be configured to add the
"X-Forwarded-For" HTTP header containing the original IP of the client
so that the reverse-proxied application can get the client's IP.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.request - Servlet's HTTP request object.javax.ws.rs.WebApplicationExceptionCopyright © 2019 DuraSpace. All rights reserved.