Package org.dspace.app.rest.utils
Class BitstreamResource
- java.lang.Object
-
- org.springframework.core.io.AbstractResource
-
- org.dspace.app.rest.utils.BitstreamResource
-
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource,org.springframework.core.io.Resource
public class BitstreamResource extends org.springframework.core.io.AbstractResourceThis class acts as aAbstractResourceused by Spring's framework to send the data in a proper and streamlined way inside theResponseEntitybody. This class' attributes are being used by Spring's framework in the overridden methods so that the proper attributes are given and used in the response.
-
-
Constructor Summary
Constructors Constructor Description BitstreamResource(Bitstream bitstream, String name, UUID uuid, long sizeBytes, UUID currentUserUUID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcontentLength()StringgetDescription()StringgetFilename()InputStreamgetInputStream()
-
-
-
Method Detail
-
getDescription
public String getDescription()
-
getInputStream
public InputStream getInputStream() throws IOException
- Throws:
IOException
-
getFilename
public String getFilename()
- Specified by:
getFilenamein interfaceorg.springframework.core.io.Resource- Overrides:
getFilenamein classorg.springframework.core.io.AbstractResource
-
contentLength
public long contentLength() throws IOException- Specified by:
contentLengthin interfaceorg.springframework.core.io.Resource- Overrides:
contentLengthin classorg.springframework.core.io.AbstractResource- Throws:
IOException
-
-