org.benow.web.css
Class CSSPathHandler

java.lang.Object
  extended by org.benow.web.path.PathHandler
      extended by org.benow.web.path.FileBasedPathHandler
          extended by org.benow.web.path.file.StaticContentPathHandler
              extended by org.benow.web.css.CSSPathHandler

public class CSSPathHandler
extends StaticContentPathHandler

A small css path handler. Delivers as static, but checks to see if /path/some.custom.css exists for requested css /path/some.css. If it does, the content of the custom css is appended to the end of the requested css. This allows for the inclusion of the custom css which overrides the custom css, and does so all in the same request, minimizing connection overhead.

Customizations to css (usually packaged in jars, such as benow-web.jar) can be done by creating a file.custom.css.

Author:
andy

Field Summary
 
Fields inherited from class org.benow.web.path.FileBasedPathHandler
base
 
Fields inherited from class org.benow.web.path.PathHandler
CONTENT_LENGTH_UNKNOWN, LAST_MODIFIED_UNKNOWN, params, request, response
 
Constructor Summary
CSSPathHandler()
           
 
Method Summary
 boolean canHandle(java.lang.String path)
          Return true if the handler can handle the given path.
protected  void deliverResource(java.lang.String requestPath, org.benow.java.packager.resource.ResourceEntry resource)
           
 
Methods inherited from class org.benow.web.path.file.StaticContentPathHandler
handle
 
Methods inherited from class org.benow.web.path.FileBasedPathHandler
deliverFile
 
Methods inherited from class org.benow.web.path.PathHandler
deliverHTML, deliverStream, deliverStream, deliverStream, handle, handle, handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSPathHandler

public CSSPathHandler()
Method Detail

canHandle

public boolean canHandle(java.lang.String path)
Description copied from class: PathHandler
Return true if the handler can handle the given path. Path is in format /dir/childdir/item.ext. It will never be null and will always start with a /.

Overrides:
canHandle in class StaticContentPathHandler
Returns:

deliverResource

protected void deliverResource(java.lang.String requestPath,
                               org.benow.java.packager.resource.ResourceEntry resource)
                        throws java.io.FileNotFoundException,
                               java.io.IOException
Overrides:
deliverResource in class FileBasedPathHandler
Throws:
java.io.FileNotFoundException
java.io.IOException