| java.lang.Object net.homeip.donaldm.httpdbase4j.StringTemplateHandler net.homeip.donaldm.httpdbase4j.ArchiveStringTemplateHandler
Constructor Summary | |
public | ArchiveStringTemplateHandler(Httpd httpd, String templateJavaPackage, java.io.File archiveFile) Constructor with template package.
Parameters: httpd - - The Httpd instance Parameters: templateJavaPackage - - The Java package where template processing classes are located. | public | ArchiveStringTemplateHandler(Httpd httpd, Templatable templateProcessor, java.io.File archiveFile) Constructor with a template processor class that implements
the Templatable interface. | public | ArchiveStringTemplateHandler(Httpd httpd, String templateJavaPackage, java.io.File archiveFile, String archiveDir) Constructor with template package.
Parameters: httpd - - The Httpd instance Parameters: templateJavaPackage - - The Java package where template processing classes are located. | public | ArchiveStringTemplateHandler(Httpd httpd, Templatable templateProcessor, java.io.File archiveFile, String archiveDir) Constructor with a template processor class that implements
the Templatable interface. |
Method Summary | |
protected StringTemplate | getTemplate(Request request) | protected Templatable | getTemplateInstance(String templateName) | public Request | onFileNotFound(long id, HttpExchange ex, Request request) | public File | onGetCachedFile(long id, HttpExchange ex, Request request) | public Object | onHandlePost(long id, HttpExchange ex, Request request, HttpResponse response, File dir, Object... extraParameters) | public boolean | onIsCacheable(long id, HttpExchange ex, Request request) Called to determine whether the resource from a request should be cached.
To implement user defined cacheing cache the file but return false and
also overide @see onGetCachedFile to return the cached file.
Parameters: id - Unique id Parameters: ex - The exchange instance for the current HTTP transaction. Parameters: request - The request instance true to cache the result, false to not cache. | public String | onListDirectory(Request request) | public void | onPostServe(long id, HttpExchange ex, Request request, boolean isOK) | public boolean | onPreServe(long id, HttpExchange ex, Request request) | public InputStream | onServeBody(long id, HttpExchange ex, Request request) | public HttpResponse | onServeHeaders(long id, HttpExchange ex, Request request) | public java.io.File | templateFile(StringTemplate template, Request request, StringBuffer mimeType, java.io.File dir) | public InputStream | templateStream(StringTemplate template, Request request, StringBuffer mimeType) | public String | templateString(StringTemplate template, Request request, StringBuffer mimeType) |
ArchiveStringTemplateHandler | public ArchiveStringTemplateHandler(Httpd httpd, String templateJavaPackage, java.io.File archiveFile) throws IOException(Code) | | Constructor with template package.
Parameters: httpd - - The Httpd instance Parameters: templateJavaPackage - - The Java package where template processing classes are located. Parameters: archiveFile - The archive file or jar file. throws: IOException - |
ArchiveStringTemplateHandler | public ArchiveStringTemplateHandler(Httpd httpd, Templatable templateProcessor, java.io.File archiveFile) throws IOException(Code) | | Constructor with a template processor class that implements
the Templatable interface.
Parameters: httpd - - The Httpd instance Parameters: templateProcessor - - A Java class that implements the Templatable interface. Parameters: archiveFile - The archive file or jar file. throws: IOException - |
ArchiveStringTemplateHandler | public ArchiveStringTemplateHandler(Httpd httpd, String templateJavaPackage, java.io.File archiveFile, String archiveDir) throws IOException(Code) | | Constructor with template package.
Parameters: httpd - - The Httpd instance Parameters: templateJavaPackage - - The Java package where template processing classes are located. Parameters: archiveFile - The archive file or jar file. Parameters: archiveDir - The directory within archiveFile where the content is found. throws: IOException - |
ArchiveStringTemplateHandler | public ArchiveStringTemplateHandler(Httpd httpd, Templatable templateProcessor, java.io.File archiveFile, String archiveDir) throws IOException(Code) | | Constructor with a template processor class that implements
the Templatable interface.
Parameters: httpd - - The Httpd instance Parameters: templateProcessor - - A Java class that implements the Templatable interface. Parameters: archiveFile - The archive file or jar file. Parameters: archiveDir - The directory within archiveFile where the content is found. throws: IOException - |
getTemplate | protected StringTemplate getTemplate(Request request)(Code) | | |
onGetCachedFile | public File onGetCachedFile(long id, HttpExchange ex, Request request)(Code) | | |
onIsCacheable | public boolean onIsCacheable(long id, HttpExchange ex, Request request)(Code) | | Called to determine whether the resource from a request should be cached.
To implement user defined cacheing cache the file but return false and
also overide @see onGetCachedFile to return the cached file.
Parameters: id - Unique id Parameters: ex - The exchange instance for the current HTTP transaction. Parameters: request - The request instance true to cache the result, false to not cache. StringTemplateHandler derived classes default to returning false to force no caching. |
onPostServe | public void onPostServe(long id, HttpExchange ex, Request request, boolean isOK)(Code) | | |
onPreServe | public boolean onPreServe(long id, HttpExchange ex, Request request)(Code) | | |
Methods inherited from net.homeip.donaldm.httpdbase4j.StringTemplateHandler | protected Class _instantiateTemplateClass(String className)(Code)(Java Doc) public boolean getCacheable()(Code)(Java Doc) abstract protected StringTemplate getTemplate(Request request)(Code)(Java Doc) abstract protected Templatable getTemplateInstance(String templateName)(Code)(Java Doc) public Request onFileNotFound(long id, HttpExchange ex, Request request)(Code)(Java Doc) public Object onHandlePost(long id, HttpExchange ex, Request request, HttpResponse response, File dir, Object... extraParameters)(Code)(Java Doc) public String onListDirectory(Request request)(Code)(Java Doc) public void onPostServe(long id, HttpExchange ex, Request request, boolean isOK)(Code)(Java Doc) public boolean onPreServe(long id, HttpExchange ex, Request request)(Code)(Java Doc) public InputStream onServeBody(long id, HttpExchange ex, Request request)(Code)(Java Doc) public HttpResponse onServeHeaders(long id, HttpExchange ex, Request request)(Code)(Java Doc) public void setCacheable(boolean isCacheable)(Code)(Java Doc) public void setDebug(boolean b)(Code)(Java Doc) public File templateFile(StringTemplate template, Request request, StringBuffer mimeType, File dir)(Code)(Java Doc) public InputStream templateStream(StringTemplate template, Request request, StringBuffer mimeType)(Code)(Java Doc) public String templateString(StringTemplate template, Request request, StringBuffer mimeType)(Code)(Java Doc)
|
|
|