Package org.trellisldp.api
Interface BinaryService
-
- All Superinterfaces:
RetrievalService<Binary>
- All Known Implementing Classes:
FileBinaryService
,InMemoryBinaryService
public interface BinaryService extends RetrievalService<Binary>
The BinaryService provides methods for retrieving, modifying and checking the validity of binary content.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
generateIdentifier(IRI identifier)
Get a new identifier.CompletionStage<Void>
purgeContent(IRI identifier)
Purge the content from its corresponding datastore.CompletionStage<Void>
setContent(BinaryMetadata metadata, InputStream stream)
Set the content for a binary object.-
Methods inherited from interface org.trellisldp.api.RetrievalService
get
-
-
-
-
Method Detail
-
setContent
CompletionStage<Void> setContent(BinaryMetadata metadata, InputStream stream)
Set the content for a binary object.- Parameters:
metadata
- the binary metadatastream
- the content- Returns:
- the new completion stage
-
purgeContent
CompletionStage<Void> purgeContent(IRI identifier)
Purge the content from its corresponding datastore.- Parameters:
identifier
- the binary object identifier- Returns:
- a new completion stage that, when the stage completes normally, indicates that the binary data
were successfully deleted from the corresponding persistence layer. In the case of an unsuccessful
operation, the
CompletionStage
will complete exceptionally and can be handled withCompletionStage.handle(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>)
,CompletionStage.exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T>)
or similar methods.
-
-