public abstract static class Operation.Download extends Operation
This operation attempts at fetching the representation associated to a resource with the ID
specified. The operation is controlled by two optional parameters:
caching(boolean)
enables or disables the use of intermediate caches, if available,
while accept(String...)
/ accept(Iterable)
require the returned
representation to have a certain MIME type (if it is not the case, the invocation fails).
Operation.Count, Operation.Create, Operation.Delete, Operation.Download, Operation.Match, Operation.Merge, Operation.Retrieve, Operation.Sparql, Operation.SparqlDelete, Operation.SparqlUpdate, Operation.Update, Operation.Upload
Modifier | Constructor and Description |
---|---|
protected |
Download(Map<String,String> inheritedNamespaces,
org.openrdf.model.URI resourceID)
Creates a new
Download operation instance. |
Modifier and Type | Method and Description |
---|---|
Operation.Download |
accept(Iterable<? extends String> mimeTypes)
Sets the acceptable MIME types (default: accept everything).
|
Operation.Download |
accept(String... mimeTypes)
Sets the acceptable MIME type (default: accept everything).
|
Operation.Download |
caching(boolean caching)
Sets whether the representation can be retrieved from caches (default true).
|
protected abstract Representation |
doExec(Long timeout,
org.openrdf.model.URI resourceID,
Set<String> mimeTypes,
boolean caching)
Implementation method responsible of executing the download operation.
|
Representation |
exec()
Executes the operation, returning the requested representation or null, if it does not
exist.
|
Operation.Download |
namespaces(Map<String,String> namespaces)
Sets the optional namespaces for this operation.
|
Operation.Download |
timeout(Long timeout)
Sets the optional timeout for this operation in milliseconds.
|
protected Download(@Nullable Map<String,String> inheritedNamespaces, org.openrdf.model.URI resourceID)
Download
operation instance.inheritedNamespaces
- an immutable map of inherited namespaces, possibly nullresourceID
- the ID of the resource whose representation should be retrievedpublic Operation.Download timeout(@Nullable Long timeout)
Operation
public Operation.Download namespaces(@Nullable Map<String,String> namespaces)
Operation
Session
. Passing null will remove any namespace map
previously set on the operation.namespaces
in class Operation
namespaces
- the namespace map overriding session namespaces; null to resetpublic final Operation.Download accept(@Nullable String... mimeTypes)
mimeTypes
- the acceptable MIME types; null (default) to drop any constraintpublic final Operation.Download accept(@Nullable Iterable<? extends String> mimeTypes)
mimeTypes
- the acceptable MIME types; null (default) to drop any constraintpublic final Operation.Download caching(boolean caching)
caching
- true, if the representation can be retrieved from cachespublic final Representation exec() throws OperationException
OperationException
- in case of failure (see possible outcome status codes)@Nullable protected abstract Representation doExec(@Nullable Long timeout, org.openrdf.model.URI resourceID, @Nullable Set<String> mimeTypes, boolean caching) throws OperationException
timeout
- the optional timeout for the operation; null if there is no timeoutresourceID
- the ID of the resource whose representation must be returnedmimeTypes
- the acceptable MIME types; null if there is no constraintcaching
- true, if the representation can be retrieved from a cacheOperationException
- in case of failure (see possible outcome status codes)Copyright © 2015–2016 FBK-irst. All rights reserved.