Package io.guise.framework.platform.web
Class GuiseHTTPServlet.AbstractDescriptionResource
java.lang.Object
io.guise.framework.platform.web.GuiseHTTPServlet.AbstractDescriptionResource
- All Implemented Interfaces:
com.globalmentor.net.Resource
- Direct Known Subclasses:
GuiseHTTPServlet.DestinationResource
- Enclosing class:
- GuiseHTTPServlet
A resource that has retrieves its properties, if possible, from a given RDF description. Recognized properties are:
Content.TYPE_PROPERTY_TAG
TODO implementContent.LENGTH_PROPERTY_TAG
Content.MODIFIED_AT_PROPERTY_TAG
- Author:
- Garret Wilson
- Implementation Note:
- This class originated in the default HTTP servlet class in the GlobalMentor servlet library.
-
Field Summary
Fields inherited from interface com.globalmentor.net.Resource
URI_PROPERTY_NAME
-
Constructor Summary
ConstructorDescriptionAbstractDescriptionResource
(URI referenceURI, io.urf.model.UrfResourceDescription resourceDescription) Constructs a resource with a reference URI and resource description. -
Method Summary
Modifier and TypeMethodDescriptionlong
getContentLength
(javax.servlet.http.HttpServletRequest request) Returns the content length of the resource.com.globalmentor.net.MediaType
getContentType
(javax.servlet.http.HttpServletRequest request) Returns the full content type of the resource, including any parameters.long
getLastModified
(javax.servlet.http.HttpServletRequest request) Returns the last modification time of the resource.io.urf.model.UrfResourceDescription
getURI()
-
Constructor Details
-
AbstractDescriptionResource
public AbstractDescriptionResource(URI referenceURI, io.urf.model.UrfResourceDescription resourceDescription) Constructs a resource with a reference URI and resource description.- Parameters:
referenceURI
- The reference URI for the new resource.resourceDescription
- The description of the resource.- Throws:
NullPointerException
- if the reference URI and/or resource description isnull
.
-
-
Method Details
-
getURI
- Specified by:
getURI
in interfacecom.globalmentor.net.Resource
-
getResourceDescription
public io.urf.model.UrfResourceDescription getResourceDescription()- Returns:
- The description of the resource.
-
getContentType
public com.globalmentor.net.MediaType getContentType(javax.servlet.http.HttpServletRequest request) throws IOException Returns the full content type of the resource, including any parameters.- Parameters:
request
- The HTTP request in response to which the content type is being retrieved.- Returns:
- The full content type of the resource with any parameters, or
null
if the content type could not be determined. - Throws:
IOException
- if there is an error getting the type of the resource.
-
getContentLength
Returns the content length of the resource.- Parameters:
request
- The HTTP request in response to which the content length is being retrieved.- Returns:
- The content length of the resource, or
-1
if the content length could not be determined. - Throws:
IOException
- if there is an error getting the length of the resource.
-
getLastModified
Returns the last modification time of the resource.- Parameters:
request
- The HTTP request in response to which the last modified time is being retrieved.- Returns:
- The time of last modification as the number of milliseconds since January 1, 1970 GMT, or
-1
if the last modified date could not be determined. - Throws:
IOException
- if there is an error getting the last modified time.
-