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
protected abstract static class GuiseHTTPServlet.AbstractDescriptionResource extends java.lang.Object
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_PROPERTY_TAG
- Author:
- Garret Wilson
- Implementation Note:
- This class originated in the default HTTP servlet class in the GlobalMentor servlet library.
-
-
Constructor Summary
Constructors Constructor Description AbstractDescriptionResource(java.net.URI referenceURI, io.urf.model.UrfResourceDescription resourceDescription)
Constructs a resource with a reference URI and resource description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getContentLength(javax.servlet.http.HttpServletRequest request)
Returns the content length of the resource.com.globalmentor.net.ContentType
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
getResourceDescription()
java.net.URI
getURI()
-
-
-
Constructor Detail
-
AbstractDescriptionResource
public AbstractDescriptionResource(java.net.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:
java.lang.NullPointerException
- if the reference URI and/or resource description isnull
.
-
-
Method Detail
-
getURI
public java.net.URI 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.ContentType getContentType(javax.servlet.http.HttpServletRequest request) throws java.io.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:
java.io.IOException
- if there is an error getting the type of the resource.
-
getContentLength
public long getContentLength(javax.servlet.http.HttpServletRequest request) throws java.io.IOException
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:
java.io.IOException
- if there is an error getting the length of the resource.
-
getLastModified
public long getLastModified(javax.servlet.http.HttpServletRequest request) throws java.io.IOException
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:
java.io.IOException
- if there is an error getting the last modified time.
-
-