Package nz.org.riskscape.engine.resource
Interface ResourceFactory
public interface ResourceFactory
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ResourceLoader loader) create
(CreateRequest toCreate) Make a request to store a resource according to the given request.default CreateHandle
create
(CreateRequest toCreate, String name, String contentType) Convenience version of create that callscreate(CreateRequest)
with a new request, derived from the given request and the given name and content type.
-
Method Details
-
add
-
load
- Throws:
ResourceLoadingException
-
load
- Throws:
ResourceLoadingException
-
load
- Throws:
ResourceLoadingException
-
getLoaders
List<ResourceLoader> getLoaders() -
create
Make a request to store a resource according to the given request.
- Returns:
- an object that has methods for completing a "transaction" for storing the data.
- Throws:
CreateException
- if the request could not be satisfied. TheProblem
attached should be able to be shown to a user for them to decide if it can be re-attempted etc. Implementors should try and validate as many preconditions for success in this method as possible.
-
create
default CreateHandle create(CreateRequest toCreate, String name, String contentType) throws CreateException Convenience version of create that calls
create(CreateRequest)
with a new request, derived from the given request and the given name and content type.- Throws:
CreateException
-