Interface LargeObjectService
- All Known Implementing Classes:
AnonLargeObjectService,SuperUserLargeObjectService,UserLargeObjectService
public interface LargeObjectService
-
Method Summary
Modifier and TypeMethodDescriptioncreateLargeObject(CreateLargeObjectRequest createLargeObjectRequest) Creates a new instance ofLargeObjectfrom the suppliedCreateLargeObjectRequest.default LargeObjectcreateLargeObject(CreateLargeObjectRequest createLargeObjectRequest, InputStream inputStream) Creates a new instance ofLargeObjectfrom the suppliedCreateLargeObjectRequestand file contents read from theInputStreamcreateLargeObjectFromUrl(CreateLargeObjectFromUrlRequest createRequest) Creates a new instance ofLargeObjectfrom the suppliedCreateLargeObjectFromUrlRequest.voiddeleteLargeObject(String objectId) Deletes the instance ofLargeObject, throw an instance ofLargeObjectNotFoundExceptionif 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 LargeObjectgetLargeObject(String objectId) Gets an instnce ofLargeObject.readLargeObjectContent(String objectId) Opens theLargeObjectfor reading.saveOrUpdateLargeObject(LargeObject largeObject) updateLargeObject(String objectId, UpdateLargeObjectRequest objectRequest) Updates the large object's metadata only.default LargeObjectupdateLargeObject(String objectId, UpdateLargeObjectRequest updateLargeObjectRequest, InputStream inputStream) Updates theLargeObjectwith the supplied object id, metadata, and file contents.default LargeObjectupdateLargeObject(String objectId, InputStream inputStream) Updates theLargeObjectwith the supplied object id and file contents.writeLargeObjectContent(String objectId) Opens theLargeObjectfor 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 theLargeObjectwith 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 theLargeObjectwith 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 ofLargeObjectfrom the suppliedCreateLargeObjectRequest.- Parameters:
createLargeObjectRequest- the large object request- Returns:
- the
LargeObjectas it was created
-
createLargeObjectFromUrl
LargeObject createLargeObjectFromUrl(CreateLargeObjectFromUrlRequest createRequest) throws IOException Creates a new instance ofLargeObjectfrom the suppliedCreateLargeObjectFromUrlRequest.- Parameters:
createRequest- the large object request- Returns:
- the
LargeObjectas 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 ofLargeObjectfrom the suppliedCreateLargeObjectRequestand file contents read from theInputStream- Parameters:
createLargeObjectRequest- the large object request- Returns:
- the
LargeObjectas it was created - Throws:
IOException- if there was an error writing the large object
-
deleteLargeObject
Deletes the instance ofLargeObject, throw an instance ofLargeObjectNotFoundExceptionif 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 theLargeObjectfor reading.- Parameters:
objectId- the object id- Returns:
- an InputStream used to read the object's contents
- Throws:
IOException
-
writeLargeObjectContent
Opens theLargeObjectfor writing.- Parameters:
objectId- the object id- Returns:
- an OutputStream used to write the object's contents.
- Throws:
IOException
-
saveOrUpdateLargeObject
-