KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > equinox > http > servlet > internal > DefaultHttpContext


1 /*******************************************************************************
2  * Copyright (c) 2005-2007 Cognos Incorporated, IBM Corporation and others
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * Cognos Incorporated - initial API and implementation
10  * IBM Corporation - bug fixes and enhancements
11  *******************************************************************************/

12
13 package org.eclipse.equinox.http.servlet.internal;
14
15 import java.io.IOException JavaDoc;
16 import java.net.URL JavaDoc;
17 import javax.servlet.http.HttpServletRequest JavaDoc;
18 import javax.servlet.http.HttpServletResponse JavaDoc;
19 import org.osgi.framework.Bundle;
20 import org.osgi.service.http.HttpContext;
21
22 public class DefaultHttpContext implements HttpContext {
23
24     private Bundle bundle;
25
26     public DefaultHttpContext(Bundle bundle) {
27         this.bundle = bundle;
28     }
29
30     public boolean handleSecurity(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) throws IOException JavaDoc {
31         // default behaviour assumes the container has already performed authentication
32
return true;
33     }
34
35     public URL JavaDoc getResource(String JavaDoc name) {
36         return bundle.getResource(name);
37     }
38
39     public String JavaDoc getMimeType(String JavaDoc name) {
40         return null;
41     }
42 }
43
Popular Tags