org.ungoverned.osgi.bundle.httpadmin.util
Class SimpleContext

java.lang.Object
  extended byorg.ungoverned.osgi.bundle.httpadmin.util.SimpleContext

public class SimpleContext
extends java.lang.Object

This is just a helper - default HttpContext implementation for an OSGi HTTP Service. It does not handle security and by default permits ANY access. It alse returns null as mime type to indicate that default mime types should be used.


Constructor Summary
SimpleContext(java.lang.Object base)
          Constructs a new simple http context to use with OSGi HTTP Service.
 
Method Summary
 java.lang.String getMimeType(java.lang.String resource)
          Returns null which is considered to be default mime type
 java.net.URL getResource(java.lang.String name)
          Reads a resource as URL.
 boolean handleSecurity(HttpServletRequest request, HttpServletResponse response)
          This method is resposible for security - e.g http sessions and logins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleContext

public SimpleContext(java.lang.Object base)
Constructs a new simple http context to use with OSGi HTTP Service.

Parameters:
base - a reference to the object which is used as base for resources which are considered to be relative to that object package name (see getResource).
Method Detail

handleSecurity

public boolean handleSecurity(HttpServletRequest request,
                              HttpServletResponse response)
This method is resposible for security - e.g http sessions and logins. Actually default implementation will always allow ANY acces.

Returns:
always true - e.g. access is allowed.

getMimeType

public java.lang.String getMimeType(java.lang.String resource)
Returns null which is considered to be default mime type


getResource

public java.net.URL getResource(java.lang.String name)
Reads a resource as URL. These resources should be relative to the base object which was given when SimpleContext class was instantiated.