Package io.milton.http
Class SimpleResource
java.lang.Object
io.milton.http.SimpleResource
- All Implemented Interfaces:
GetableResource,PostableResource,Resource
- Direct Known Subclasses:
SimpleDigestResource
A very simple resource implementation, which simply takes parameters in the
constructor to define the resource, which includes the content
Can be useful for resources defined in by code, where the content is a classpath
item
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(String user, String password) booleanauthorise(Request request, Request.Method method, Auth auth) checkRedirect(Request request) getContentType(String accepts) getMaxAgeSeconds(Auth auth) getName()getRealm()voidsendContent(OutputStream out, Range range, Map<String, String> params, String contentType)
-
Constructor Details
-
SimpleResource
-
SimpleResource
-
-
Method Details
-
sendContent
public void sendContent(OutputStream out, Range range, Map<String, String> params, String contentType) throws IOException- Specified by:
sendContentin interfaceGetableResource- Throws:
IOException
-
getMaxAgeSeconds
- Specified by:
getMaxAgeSecondsin interfaceGetableResource
-
getContentType
- Specified by:
getContentTypein interfaceGetableResource
-
getContentLength
- Specified by:
getContentLengthin interfaceGetableResource
-
getUniqueId
- Specified by:
getUniqueIdin interfaceResource
-
getName
-
authenticate
- Specified by:
authenticatein interfaceResource
-
authorise
-
getRealm
-
getModifiedDate
- Specified by:
getModifiedDatein interfaceResource
-
checkRedirect
- Specified by:
checkRedirectin interfaceResource
-
processForm
public String processForm(Map<String, String> parameters, Map<String, throws BadRequestException, NotAuthorizedException, ConflictExceptionFileItem> files) - Specified by:
processFormin interfacePostableResource- Throws:
BadRequestExceptionNotAuthorizedExceptionConflictException
-