Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Muskalla2008-04-18 14:31:06 +0000
committerBenjamin Muskalla2008-04-18 14:31:06 +0000
commit1e4a3c479aaad0fcb92259406ab36036d3917026 (patch)
tree2cac333d9699e5a375b2bd027fb4bbcfe95a88dc /bundles/org.eclipse.rap.ui/src
parent7ffaa4e81ac1c33c603510ccebb4e8b0724ad6b7 (diff)
downloadorg.eclipse.rap-1e4a3c479aaad0fcb92259406ab36036d3917026.tar.gz
org.eclipse.rap-1e4a3c479aaad0fcb92259406ab36036d3917026.tar.xz
org.eclipse.rap-1e4a3c479aaad0fcb92259406ab36036d3917026.zip
added rap context
Diffstat (limited to 'bundles/org.eclipse.rap.ui/src')
-rw-r--r--bundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/RAPHttpContext.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/bundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/RAPHttpContext.java b/bundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/RAPHttpContext.java
new file mode 100644
index 0000000000..a1800e99f9
--- /dev/null
+++ b/bundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/RAPHttpContext.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2002-2008 Innoopract Informationssysteme GmbH. All rights
+ * reserved. This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0 which accompanies this
+ * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
+ * Contributors: Innoopract Informationssysteme GmbH - initial API and
+ * implementation
+ ******************************************************************************/
+package org.eclipse.ui.internal;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+import org.osgi.service.http.HttpContext;
+
+// NOTE: This was added to org.eclipse.rap.ui to avoid starting
+// the workbench bundle before the context is established. The latter
+// uses the context already on startup
+public class RAPHttpContext implements HttpContext {
+ private final Bundle bundle;
+
+ public RAPHttpContext() {
+ bundle = Platform.getBundle( "org.eclipse.ui" ); //$NON-NLS-1$
+ }
+
+ public boolean handleSecurity( final HttpServletRequest request,
+ final HttpServletResponse response )
+ throws IOException
+ {
+ // default behaviour assumes the container has already performed
+ // authentication
+ return true;
+ }
+
+ public URL getResource( final String name ) {
+ return bundle.getResource( name );
+ }
+
+ public String getMimeType( final String name ) {
+ return null;
+ }
+}

Back to the top