public interface ResourceFactory
| Modifier and Type | Method and Description |
|---|---|
Resource |
getResource(String host,
String path)
Locate an instance of a resource at the given url and on the given host.
|
Resource getResource(String host, String path) throws io.milton.http.exceptions.NotAuthorizedException, io.milton.http.exceptions.BadRequestException
http://milton.ettrema.com:80/downloads/index.html?ABC=123the corresponding arguments will be:
host: milton.ettrema.com:80 path: /downloads/index.htmlNote that your implementation should not be sensitive to trailing slashes E.g. these paths should return the same resource /apath and /apath/ Return null if there is no associated
Resource object.
You should generally avoid using any request information other then that
provided in the method arguments. But if you find you need to you can access the
request and response objects from HttpManager.request() and HttpManager.response()host - Full host name with port number, e.g. milton.ettrema.com:80path - Relative path on server, e.g. /downloads/index.htmlio.milton.http.exceptions.NotAuthorizedExceptionio.milton.http.exceptions.BadRequestException