Interface LargeObjectService
- All Known Implementing Classes:
AnonLargeObjectService
,SuperUserLargeObjectService
,UserLargeObjectService
public interface LargeObjectService
-
Method Summary
Modifier and TypeMethodDescriptioncreateLargeObject
(CreateLargeObjectRequest createLargeObjectRequest) Creates a new instance ofLargeObject
from the suppliedCreateLargeObjectRequest
.default LargeObject
createLargeObject
(CreateLargeObjectRequest createLargeObjectRequest, InputStream inputStream) Creates a new instance ofLargeObject
from the suppliedCreateLargeObjectRequest
and file contents read from theInputStream
createLargeObjectFromUrl
(CreateLargeObjectFromUrlRequest createRequest) Creates a new instance ofLargeObject
from the suppliedCreateLargeObjectFromUrlRequest
.void
deleteLargeObject
(String objectId) Deletes the instance ofLargeObject
, throw an instance ofLargeObjectNotFoundException
if the large object does not exist or the currently logged-in user does not have permission to access.findLargeObject
(String objectId) Finds an instance ofLargeObject
.default LargeObject
getLargeObject
(String objectId) Gets an instnce ofLargeObject
.readLargeObjectContent
(String objectId) Opens theLargeObject
for reading.saveOrUpdateLargeObject
(LargeObject largeObject) updateLargeObject
(String objectId, UpdateLargeObjectRequest objectRequest) Updates the large object's metadata only.default LargeObject
updateLargeObject
(String objectId, UpdateLargeObjectRequest updateLargeObjectRequest, InputStream inputStream) Updates theLargeObject
with the supplied object id, metadata, and file contents.default LargeObject
updateLargeObject
(String objectId, InputStream inputStream) Updates theLargeObject
with the supplied object id and file contents.writeLargeObjectContent
(String objectId) Opens theLargeObject
for writing.
-
Method Details
-
findLargeObject
Finds an instance ofLargeObject
. If the currently logged-in user may not access the supplied object or it if it is not found, then this will return a result equivalent toOptional.empty()
.- Parameters:
objectId
- the object id- Returns:
- the
Optional<LargeObject>
, never null
-
getLargeObject
Gets an instnce ofLargeObject
.- Parameters:
objectId
- the object ID- Returns:
- the
LargeObject
, never null - Throws:
NotFoundException
- if no object exists with that supplied id
-
updateLargeObject
Updates the large object's metadata only.- Parameters:
objectId
- the object idobjectRequest
- theUpdateLargeObjectRequest
- Returns:
- the large object
-
updateLargeObject
Updates theLargeObject
with the supplied object id and file contents.- Parameters:
objectId
- the large object's idinputStream
- the input stream to read for the object's contents- Returns:
- the large object
- Throws:
IOException
- if there was an error writing the large object
-
updateLargeObject
default LargeObject updateLargeObject(String objectId, UpdateLargeObjectRequest updateLargeObjectRequest, InputStream inputStream) throws IOException Updates theLargeObject
with the supplied object id, metadata, and file contents.- Parameters:
objectId
- the large object's idinputStream
- the input stream to read for the object's contents- Returns:
- the large object
- Throws:
IOException
- if there was an error writing the large object
-
createLargeObject
Creates a new instance ofLargeObject
from the suppliedCreateLargeObjectRequest
.- Parameters:
createLargeObjectRequest
- the large object request- Returns:
- the
LargeObject
as it was created
-
createLargeObjectFromUrl
LargeObject createLargeObjectFromUrl(CreateLargeObjectFromUrlRequest createRequest) throws IOException Creates a new instance ofLargeObject
from the suppliedCreateLargeObjectFromUrlRequest
.- Parameters:
createRequest
- the large object request- Returns:
- the
LargeObject
as it was created - Throws:
IOException
- if there was an error writing the large object
-
createLargeObject
default LargeObject createLargeObject(CreateLargeObjectRequest createLargeObjectRequest, InputStream inputStream) throws IOException Creates a new instance ofLargeObject
from the suppliedCreateLargeObjectRequest
and file contents read from theInputStream
- Parameters:
createLargeObjectRequest
- the large object request- Returns:
- the
LargeObject
as it was created - Throws:
IOException
- if there was an error writing the large object
-
deleteLargeObject
Deletes the instance ofLargeObject
, throw an instance ofLargeObjectNotFoundException
if the large object does not exist or the currently logged-in user does not have permission to access.- Parameters:
objectId
- the object id- Throws:
IOException
-
readLargeObjectContent
Opens theLargeObject
for reading.- Parameters:
objectId
- the object id- Returns:
- an InputStream used to read the object's contents
- Throws:
IOException
-
writeLargeObjectContent
Opens theLargeObject
for writing.- Parameters:
objectId
- the object id- Returns:
- an OutputStream used to write the object's contents.
- Throws:
IOException
-
saveOrUpdateLargeObject
-