java.lang.Object
org.klomp.snark.web.BasicServlet.JarContent
- All Implemented Interfaces:
BasicServlet.HttpContent
- Enclosing class:
BasicServlet
HTTP content backed by an entry in the war file.
Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionintThe cache time.longThe content length.The content type.The input stream.longThe last modified time.toString()String form of the servlet.
Field Details
_path
Path of the entry inside the war file.
Constructor Details
JarContent
Builds the content for one war entry.- Parameters:
path- the path of the entry inside the war file
Method Details
getContentType
The content type.- Specified by:
getContentTypein interfaceBasicServlet.HttpContent- Returns:
- the MIME type for the response header
getLastModified
public long getLastModified()The last modified time.- Specified by:
getLastModifiedin interfaceBasicServlet.HttpContent- Returns:
- the last modified
getCacheTime
public int getCacheTime()The cache time.- Specified by:
getCacheTimein interfaceBasicServlet.HttpContent- Returns:
- max-age in seconds for the Cache-Control header
getContentLength
public long getContentLength()The content length.- Specified by:
getContentLengthin interfaceBasicServlet.HttpContent- Returns:
- the byte length for the Content-Length header
getInputStream
The input stream.- Specified by:
getInputStreamin interfaceBasicServlet.HttpContent- Returns:
- a stream over the response body
- Throws:
IOException- if the content cannot be opened for reading
toString