clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [46/51] [partial] clerezza git commit: CLEREZZA-1012: reduced clerezza to core components, the rest stays in legacy-branch
Date Mon, 03 Oct 2016 15:50:12 GMT
http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.stanbol.fragments/LICENSE
----------------------------------------------------------------------
diff --git a/jaxrs.stanbol.fragments/LICENSE b/jaxrs.stanbol.fragments/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/jaxrs.stanbol.fragments/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.stanbol.fragments/pom.xml
----------------------------------------------------------------------
diff --git a/jaxrs.stanbol.fragments/pom.xml b/jaxrs.stanbol.fragments/pom.xml
deleted file mode 100644
index ad94942..0000000
--- a/jaxrs.stanbol.fragments/pom.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <artifactId>clerezza</artifactId>
-        <groupId>org.apache.clerezza</groupId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>jaxrs.stanbol.fragments</artifactId>
-    <packaging>bundle</packaging>
-    <version>1.0.0-SNAPSHOT</version>
-    <name>Clerezza - Support for Stanbol Webfragments</name>
-    <description>Adds support to use Stanbol webfragments based applications in clerezza</description>
-    <dependencies>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.wink</groupId>
-            <artifactId>wink-osgi</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza.ext</groupId>
-            <artifactId>org.json.simple</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.globalmenu.api</artifactId>
-            <version>0.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stanbol</groupId>
-            <artifactId>org.apache.stanbol.commons.web.base</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.scala-lang</groupId>
-            <artifactId>scala-library</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.clerezza.ext</groupId>
-          <artifactId>slf4j-scala-api</artifactId>
-            <version>1.6.3</version>
-        </dependency>
-        <dependency>
-          <groupId>org.osgi</groupId>
-          <artifactId>org.osgi.core</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.osgi</groupId>
-          <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.clerezza</groupId>
-          <artifactId>osgi.services</artifactId>
-            <version>0.2</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <sourceDirectory>src/main/scala</sourceDirectory>
-        <testSourceDirectory>src/test/scala</testSourceDirectory>
-        <plugins>
-            <plugin>
-                <groupId>org.scala-tools</groupId>
-                <artifactId>maven-scala-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.3.7</version>
-                <configuration>
-                    <instructions>
-                        <Import-Package>!org.apache.felix.scr.annotations, *</Import-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <configuration>
-                    <scanClasses>true</scanClasses>
-                    <instructions>
-                        <scanClasses>true</scanClasses>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.stanbol.fragments/src/main/scala/org/apache/clerezza/jaxrs/stanbol/webfragements/WebFragmentRunner.scala
----------------------------------------------------------------------
diff --git a/jaxrs.stanbol.fragments/src/main/scala/org/apache/clerezza/jaxrs/stanbol/webfragements/WebFragmentRunner.scala b/jaxrs.stanbol.fragments/src/main/scala/org/apache/clerezza/jaxrs/stanbol/webfragements/WebFragmentRunner.scala
deleted file mode 100644
index 2cae248..0000000
--- a/jaxrs.stanbol.fragments/src/main/scala/org/apache/clerezza/jaxrs/stanbol/webfragements/WebFragmentRunner.scala
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright 2012 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.clerezza.jaxrs.stanbol.webfragements
-
-import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
-import org.apache.wink.osgi.WinkRequestProcessor
-import java.util.ArrayList
-import java.util.Collections
-import javax.servlet.FilterChain
-import javax.servlet.Servlet
-import javax.servlet.ServletContext
-import javax.servlet.ServletRequest
-import javax.servlet.ServletResponse
-import javax.servlet.http.HttpServlet
-import javax.ws.rs.ext.ContextResolver
-import javax.ws.rs.ext.Provider
-import org.apache.clerezza.osgi.services.ActivationHelper
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItem
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider
-import org.apache.felix.scr.annotations._
-import org.apache.stanbol.commons.web.base.LinkResource
-import org.apache.stanbol.commons.web.base.NavigationLink
-import org.apache.stanbol.commons.web.base.ScriptResource
-import org.apache.stanbol.commons.web.base.WebFragment
-import org.osgi.framework.BundleContext
-import org.osgi.framework.ServiceReference
-import org.osgi.service.component.ComponentContext
-import org.slf4j.scala.Logging
-
-
-
-@Component
-@Reference(name = "webFragment", 
-           referenceInterface = classOf[WebFragment], 
-           cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, 
-           policy = ReferencePolicy.DYNAMIC)
-//@Service(Array(classOf[Servlet]))
-//@Property(name = "alias", value = Array("/stanbol-ugly-servlet-context-initializer"))
-@Service(value = Array(classOf[javax.servlet.Filter], classOf[GlobalMenuItemsProvider]))
-@Property(name ="pattern", value=Array(".*"))
-class WebFragmentRunner extends javax.servlet.Filter with GlobalMenuItemsProvider with Logging {
-
-  @Reference
-  private var winkRequestProcessor: WinkRequestProcessor = _
-  
-  @Property(name = "org.apache.stanbol.commons.web.alias", value = Array("/"))
-  final val ALIAS_PROPERTY = "org.apache.stanbol.commons.web.alias";
-
-  @Property(name = STATIC_RESOURCES_URL_ROOT_PROPERTY, value = Array("/static"))
-  final val STATIC_RESOURCES_URL_ROOT_PROPERTY = "org.apache.stanbol.commons.web.static.url";
-
-  /**
-   * The origins allowed for multi-host requests
-   */
-  @Property(name = CORS_ORIGIN, cardinality = 100, value = Array("*"))
-  final val CORS_ORIGIN = "org.apache.stanbol.commons.web.cors.origin";
-
-  @Property(name = CORS_ACCESS_CONTROL_EXPOSE_HEADERS, cardinality = 100, value = Array("Location"))
-  final val CORS_ACCESS_CONTROL_EXPOSE_HEADERS = "org.apache.stanbol.commons.web.cors.access_control_expose_headers";
-
-  
-  private var webFragments: List[WebFragment] = Nil
-  private var bundleContext: BundleContext = _
-  private var activator: Option[ActivationHelper] = None
-  
-  private val linkResources = new ArrayList[LinkResource]();
-  private val scriptResources = new ArrayList[ScriptResource]();
-  private val navigationLinks = new ArrayList[NavigationLink]();
-  
-  private var staticUrlRoot: String = _
-  private var applicationAlias: String = _
-  
-  private var corsOrigins : java.util.Set[String] = _
-  private var exposedHeaders : java.util.Set[String] = _
-  private var contextResolverImpl : ContextResolverImpl = _
-  
-  val menuItems = new java.util.HashSet[GlobalMenuItem]
-
-
-  @Activate
-  def activate(c: ComponentContext) {
-    staticUrlRoot = c.getProperties().get(
-      STATIC_RESOURCES_URL_ROOT_PROPERTY).asInstanceOf[String]
-    applicationAlias = c.getProperties().get(
-      ALIAS_PROPERTY).asInstanceOf[String];
-    {
-      val values = c.getProperties().get(CORS_ORIGIN);
-      values match {
-        case s: String => corsOrigins =  Collections.singleton(s)
-        case i: java.lang.Iterable[_] => {
-            corsOrigins = new java.util.HashSet[String]();
-            val iter = i.iterator
-            while (iter.hasNext) {
-              corsOrigins.add(iter.next().toString)
-            };
-        }
-      }
-    }
-    {
-      val values = c.getProperties().get(CORS_ACCESS_CONTROL_EXPOSE_HEADERS);
-      values match {
-        case s: String => exposedHeaders = Collections.singleton(s)
-        case i: java.lang.Iterable[_] => {
-            exposedHeaders = new java.util.HashSet[String]();
-            val iter = i.iterator
-            while (iter.hasNext) {
-              exposedHeaders.add(iter.next().toString)
-            }
-        }
-      }
-    }
-    synchronized {
-      println("activating with "+webFragments);
-      bundleContext = c.getBundleContext
-      registerFragments()
-    }
-  }
-  
-  @Deactivate
-  def deactivate(c: ComponentContext) {
-    synchronized {
-      unregisterClasses()
-      activator.foreach(_.stop(c.getBundleContext))
-      activator = None
-    }
-  }
-
-  private def registerFragments() {
-    activator = Some(new ActivationHelper {
-      
-      for (f <- webFragments) {
-        import scala.collection.JavaConverters._
-        for (s <- f.getJaxrsResourceSingletons.asScala) {
-          //could alos direcly invoke wink as below
-          registerRootResource(s)
-          logger.info("Registered: "+s)
-        }
-        for (c <- f.getJaxrsResourceClasses.asScala) {
-            winkRequestProcessor.bindComponentClass(c)
-            logger.info("Registered class: "+c)
-        }
-      }
-      start (bundleContext)
-    })
-  }
-  
-  private def unregisterClasses() {
-    for (f <- webFragments) {
-        import scala.collection.JavaConverters._
-        for (c <- f.getJaxrsResourceClasses.asScala) {
-            winkRequestProcessor.unbindComponentClass(c)
-            logger.info("Unregistered class: "+c)
-        }
-      }
-  }
-
-  protected def bindWebFragment(f: WebFragment) {
-    linkResources.addAll(f.getLinkResources());
-    scriptResources.addAll(f.getScriptResources());
-    navigationLinks.addAll(f.getNavigationLinks());
-    {
-      import scala.collection.JavaConverters._
-      for (nl <- f.getNavigationLinks.asScala) {
-        menuItems.add(new GlobalMenuItem("/"+nl.getPath, nl.getLabel, nl.getLabel, nl.getOrder, "Stanbol"))
-      }
-    };
-    synchronized {
-      webFragments ::= f
-      activator.foreach { a =>
-        unregisterClasses();
-        a.stop(bundleContext);
-        registerFragments()
-      }
-    } 
-  }
-
-  protected def unbindWebFragment(f: WebFragment) {
-    linkResources.removeAll(f.getLinkResources());
-    scriptResources.removeAll(f.getScriptResources());
-    navigationLinks.removeAll(f.getNavigationLinks());
-    {
-      import scala.collection.JavaConverters._
-      for (nl <- f.getNavigationLinks.asScala) {
-        menuItems.remove(new GlobalMenuItem("/"+nl.getPath, nl.getLabel, nl.getLabel, nl.getOrder, "Stanbol"))
-      }
-    };
-    synchronized {
-      webFragments = webFragments diff List(f)
-      activator.foreach { a=>
-        unregisterClasses()
-        a.stop(bundleContext);
-        registerFragments()
-      }
-    }
-  }
-  
-  //all this servlet stuff is only needed to get the servlet context
-  //override def init(config: javax.servlet.ServletConfig) {
-  override def init(config: javax.servlet.FilterConfig) {
-    val servletContext = config.getServletContext
-
-    Collections.sort(linkResources);
-    Collections.sort(scriptResources);
-    Collections.sort(navigationLinks);
-    servletContext.setAttribute(classOf[BundleContext].getName(), bundleContext);
-    servletContext.setAttribute(BaseStanbolResource.ROOT_URL, applicationAlias);
-    servletContext.setAttribute(BaseStanbolResource.STATIC_RESOURCES_ROOT_URL, staticUrlRoot);
-    servletContext.setAttribute(BaseStanbolResource.LINK_RESOURCES, linkResources);
-    servletContext.setAttribute(BaseStanbolResource.SCRIPT_RESOURCES, scriptResources);
-    servletContext.setAttribute(BaseStanbolResource.NAVIGATION_LINKS, navigationLinks);
-    servletContext.setAttribute(CORS_ORIGIN, corsOrigins);
-    servletContext.setAttribute(CORS_ACCESS_CONTROL_EXPOSE_HEADERS, exposedHeaders);
-    contextResolverImpl = new ContextResolverImpl(servletContext)
-    winkRequestProcessor.bindComponent(contextResolverImpl)
-  }
-  
-  override def doFilter(request: ServletRequest, response: ServletResponse,
-      chain: FilterChain){
-    chain.doFilter(request, response);
-  }
-
-  override def destroy() {
-      winkRequestProcessor.unbindComponent(contextResolverImpl)
-  }
-
-  def getMenuItems() : java.util.Set[GlobalMenuItem]  = {
-
-    return menuItems
-  }
-
-  @Provider
-  class ContextResolverImpl(servletContext: ServletContext) extends ContextResolver[ServletContext] {
-
-    def getContext(clazz: Class[_]): ServletContext = {
-        def wrapped = servletContext;
-        new ServletContext() {
-          def getServletContextName() :String = { wrapped.getServletContextName()}
-      def removeAttribute(name: String) :Unit = { wrapped.removeAttribute(name)}
-      def setAttribute(name: String, value: Any) :Unit = { wrapped.setAttribute(name, value)}
-      def getAttributeNames() :java.util.Enumeration[_] = { wrapped.getAttributeNames()}
-      def getAttribute(name: String) :Object = { 
-              val result = wrapped.getAttribute(name)
-              if (result != null) {
-                result
-              } else {
-                val serviceReference = bundleContext.getServiceReference(name) //: ServiceReference[Object]
-                if (serviceReference != null) {
-                  bundleContext.getService(serviceReference).asInstanceOf[Object]
-                } else null
-              }
-            }
-      def getInitParameterNames() :java.util.Enumeration[_] = { wrapped.getInitParameterNames()}
-      def getInitParameter(name: String) :String = { wrapped.getInitParameter(name)}
-      def getServerInfo() :String = { wrapped.getServerInfo()}
-      def getRealPath(name: String) :String = { wrapped.getRealPath(name)}  
-      def log(message: String, exception: Throwable) :Unit = { wrapped.log(message,exception)}
-      def log(exception: Exception, message: String) :Unit = { wrapped.log(exception, message)}
-      def log(message: String) :Unit = { wrapped.log(message)}
-      @Deprecated
-      def getServletNames() :java.util.Enumeration[_] = { wrapped.getServletNames()}
-      @Deprecated
-      def getServlets() :java.util.Enumeration[_] = { wrapped.getServlets()}
-      @Deprecated
-      def getServlet(name: String) :javax.servlet.Servlet = { wrapped.getServlet(name)}
-      def getNamedDispatcher(name: String) :javax.servlet.RequestDispatcher = { wrapped.getNamedDispatcher(name)}
-      def getRequestDispatcher(path: String) :javax.servlet.RequestDispatcher = { wrapped.getRequestDispatcher(path)}
-      def getResourceAsStream(path: String) :java.io.InputStream = { wrapped.getResourceAsStream(path)}
-      def getResource(path: String) :java.net.URL = { wrapped.getResource(path)}
-      def getResourcePaths(path: String) :java.util.Set[_] = { wrapped.getResourcePaths(path)}
-      def getMimeType(file: String) :String = { wrapped.getMimeType(file)}
-      def getMinorVersion() :Int = { wrapped.getMajorVersion()}
-      def getMajorVersion() :Int = { wrapped.getMajorVersion()}
-      def getContext(uripath: String) :javax.servlet.ServletContext = { wrapped.getContext(uripath)}
-      def getContextPath() :String = { wrapped.getContextPath()}
-        }
-    }
-  }
-}
-
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/LICENSE
----------------------------------------------------------------------
diff --git a/jaxrs.utils/LICENSE b/jaxrs.utils/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/jaxrs.utils/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/pom.xml
----------------------------------------------------------------------
diff --git a/jaxrs.utils/pom.xml b/jaxrs.utils/pom.xml
deleted file mode 100644
index 4ac7c07..0000000
--- a/jaxrs.utils/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <artifactId>clerezza</artifactId>
-        <groupId>org.apache.clerezza</groupId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>jaxrs.utils</artifactId>
-    <packaging>bundle</packaging>
-    <version>1.0.0-SNAPSHOT</version>
-    <name>Clerezza - JAX-RS Utilities</name>
-    <description>Utility classes for JAX-RS (see the Javadoc)</description>
-    <dependencies>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <!-- testing with last released version, testutils is doscontinued as
-       triaxrs is -->
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>jaxrs.testutils</artifactId>
-            <scope>test</scope>
-            <version>0.9-incubating</version>
-        </dependency>
-        <dependency>
-            <groupId>com.googlecode.json-simple</groupId>
-            <artifactId>json-simple</artifactId>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/JSONObjectMessageBodyWriter.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/JSONObjectMessageBodyWriter.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/JSONObjectMessageBodyWriter.java
deleted file mode 100644
index 58981e1..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/JSONObjectMessageBodyWriter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.clerezza.jaxrs.utils;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
-
-import org.json.simple.JSONObject;
-
-@Component
-@Service(Object.class)
-@Property(name="javax.ws.rs", boolValue=true)
-@Provider
-@Produces("application/json")
-public class JSONObjectMessageBodyWriter implements
-        MessageBodyWriter<JSONObject> {
-
-    private static final String UTF8 = "UTF-8";
-
-    @Override
-    public long getSize(JSONObject jsonObject, Class<?> type, Type genericType,
-            Annotation[] annotations, MediaType mediaType) {
-        try {
-            return jsonObject.toJSONString().getBytes(UTF8).length;
-        } catch (UnsupportedEncodingException ex) {
-            return -1;
-        }
-    }
-
-    @Override
-    public boolean isWriteable(Class<?> type, Type genericType,
-            Annotation[] annotations, MediaType mediaType) {
-        return JSONObject.class.isAssignableFrom(type);
-    }
-
-    @Override
-    public void writeTo(JSONObject value, Class<?> type, Type genericType,
-            Annotation[] annotations, MediaType mediaType,
-            MultivaluedMap<String, Object> httpHeaders, OutputStream out)
-            throws IOException {
-        out.write(value.toJSONString().getBytes(UTF8));
-        out.flush();
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/RedirectUtil.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/RedirectUtil.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/RedirectUtil.java
deleted file mode 100644
index a4a1df9..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/RedirectUtil.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.clerezza.jaxrs.utils;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import java.net.URL;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.UriInfo;
-
-/**
- * Provides a utility method to create a Response redirecting to another
- * location.
- *
- * @author mir
- */
-public class RedirectUtil {
-
-    /**
-     * Redirects to the location provided by uriString in the context of the
-     * request uri provided by baseUri.
-     *
-     * @param uriString
-     * @param baseUri
-     * @return {@link javax.ws.rs.core.Response}
-     */
-    public static Response createSeeOtherResponse(String uriString, 
-            UriInfo baseUri) {
-        try {
-            return createSeeOtherResponse(uriString, baseUri.getAbsolutePath().toURL());
-        } catch (MalformedURLException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    /**
-     * Redirects to the location provided by uriString in the context
-     * specified by baseUrl.
-     *
-     * @param uriString
-     * @param baseUrl
-     * @return {@link javax.ws.rs.core.Response}
-     */
-    public static Response createSeeOtherResponse(String uriString,
-            URL baseUrl) {
-
-        String htmlBody = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"" +
-            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">" +
-            "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">" +
-            "<body> <a href=\"" + uriString + "\">" + uriString + "</a><body></html>";
-        try {
-            URL absoluteUrl = new URL(baseUrl, uriString);
-            final URI uri = absoluteUrl.toURI();
-            ResponseBuilder responseBuilder = Response.status(Response.Status.SEE_OTHER);
-            responseBuilder = responseBuilder.entity(htmlBody);
-            responseBuilder = responseBuilder.location(uri);
-            return responseBuilder.build();
-        } catch (URISyntaxException ex) {
-            throw new RuntimeException(ex);
-        } catch (MalformedURLException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/TrailingSlash.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/TrailingSlash.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/TrailingSlash.java
deleted file mode 100644
index 66e13ba..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/TrailingSlash.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.clerezza.jaxrs.utils;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.Response.ResponseBuilder;
-
-/**
- * The TrailingSlash utility checks if the URI given through
- * <code>UriInfo</code> ends or doesn't end with a slash ('/'). If the URI does not
- * conform, then a <code>WebApplicationException<code>
- * is thrown. This exception contains a response with status code 303 ("See-Other"),
- * causing a redirect to the correct URI.
- * 
- * @author mir
- * 
- */
-public class TrailingSlash {
-
-    /**
-     * Checks if an slash ('/') is present at the end of the URI given by
-     * <code>UriInfo</code>. If not then a redirect is triggered to the URI with
-     * the slash at the end.
-     * 
-     * @param uriInfo
-     */
-    public static void enforcePresent(UriInfo uriInfo) {
-        String absolutPath = uriInfo.getAbsolutePath().toString();
-        if (!absolutPath.endsWith("/")) {
-            String redirectUri = absolutPath + "/";
-            Response response = createSeeOtherResponse(redirectUri);
-            throw new WebApplicationException(response);
-        }
-    }
-
-    /**
-     * Checks if no slash ('/') is present at the end of the URI given by
-     * <code>UriInfo</code>. If a slash is present, a redirect is triggered to
-     * the URI with no slash at the end.
-     * 
-     * @param uriInfo
-     */
-    public static void enforceNotPresent(UriInfo uriInfo) {
-        String absolutPath = uriInfo.getAbsolutePath().toString();
-        if (absolutPath.endsWith("/")) {
-            String redirectUri = absolutPath.substring(0,
-                    absolutPath.length() - 1);
-            Response response = createSeeOtherResponse(redirectUri);
-            throw new WebApplicationException(response);
-        }
-    }
-
-    private static Response createSeeOtherResponse(String redirectUri) {
-        URI seeOtherUri = null;
-        try {
-            seeOtherUri = new URI(redirectUri);
-        } catch (URISyntaxException e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
-        ResponseBuilder rb = Response.seeOther(seeOtherUri);
-        return rb.build();
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/AbstractParameterCollection.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/AbstractParameterCollection.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/AbstractParameterCollection.java
deleted file mode 100644
index 81f304e..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/AbstractParameterCollection.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright  2002-2006 WYMIWYG (http://wymiwyg.org)
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-package org.apache.clerezza.jaxrs.utils.form;
-
-import java.util.AbstractCollection;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * An ordered collection of labeled parameter-values
- * 
- * This class is not thread-safe.
- * 
- * @author reto
- * 
- */
-public abstract class AbstractParameterCollection extends
-        AbstractCollection<KeyValuePair<ParameterValue>> {
-
-    /**
-     * the rawColletion contains the KeyValuePairS, this may be set a value by
-     * the subclass or it is given a value on invocation of the size() and
-     * getParameter* methods of this class.
-     */
-    protected List<KeyValuePair<ParameterValue>> rawCollection = null;
-
-    public String[] getParameterNames() {
-        if (rawCollection == null) {
-            createRawCollection();
-        }
-        List<String> resultList = new ArrayList<String>();
-        for (KeyValuePair<ParameterValue> keyValuePair : rawCollection) {
-            String key = keyValuePair.getKey();
-            if (!resultList.contains(key)) {
-                resultList.add(key);
-            }
-        }
-        return resultList.toArray(new String[resultList.size()]);
-    }
-
-    public ParameterValue[] getParameteValues(String parameterName) {
-        if (rawCollection == null) {
-            createRawCollection();
-        }
-        List<ParameterValue> resultList = new ArrayList<ParameterValue>();
-        for (KeyValuePair<ParameterValue> keyValuePair : rawCollection) {
-            if (keyValuePair.getKey().equals(parameterName)) {
-                resultList.add(keyValuePair.getValue());
-            }
-        }
-        return resultList.toArray(new ParameterValue[resultList.size()]);
-    }
-
-    @Override
-    public int size() {
-        if (rawCollection == null) {
-            createRawCollection();
-        }
-        return rawCollection.size();
-    }
-
-    /**
-     * 
-     */
-    private void createRawCollection() {
-        Iterator<KeyValuePair<ParameterValue>> iterator = iterator();
-        if (rawCollection == null) {
-            // the call to the implementations iterator() didn't create
-            // rawCollection
-            rawCollection = new ArrayList<KeyValuePair<ParameterValue>>();
-            while (iterator.hasNext()) {
-                rawCollection.add(iterator.next());
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/DelimiterInputStream.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/DelimiterInputStream.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/DelimiterInputStream.java
deleted file mode 100644
index 5183b2e..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/DelimiterInputStream.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright  2002-2004 WYMIWYG (www.wymiwyg.org)
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-package org.apache.clerezza.jaxrs.utils.form;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PushbackInputStream;
-
-/**
- * @author reto
- * 
- */
-public class DelimiterInputStream extends PushbackInputStream {
-
-    static int MAX_DELIMITER_SIZE = 300;
-
-    /**
-     * @param in
-     */
-    public DelimiterInputStream(InputStream in) {
-        super(in, MAX_DELIMITER_SIZE);
-    }
-
-    /**
-     * reads till delimiter is found
-     * 
-     * @param delimiter
-     * @return the bytes read till the beginning of delimiter
-     * @throws IOException
-     * @throws DelimiterNotFoundException
-     */
-    public byte[] readTill(byte[] delimiter) throws IOException,
-            DelimiterNotFoundException {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        int posInDelimiter = 0;
-        while (true) {
-            int ch = read();
-            if (ch == -1) {
-                throw new DelimiterNotFoundException(baos.toByteArray());
-            }
-            if (ch == delimiter[posInDelimiter]) {
-                posInDelimiter++;
-                if (posInDelimiter == delimiter.length) {
-                    return baos.toByteArray();
-                }
-            } else {
-                if (posInDelimiter > 0) {
-                    unread(ch);
-                    unread(delimiter, 1, posInDelimiter - 1);
-                    posInDelimiter = 0;
-                    ch = delimiter[0];
-                }
-                baos.write(ch);
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/DelimiterNotFoundException.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/DelimiterNotFoundException.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/DelimiterNotFoundException.java
deleted file mode 100644
index 7e01958..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/DelimiterNotFoundException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright  2002-2004 WYMIWYG (www.wymiwyg.org)
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-package org.apache.clerezza.jaxrs.utils.form;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-/**
- * @author reto
- *
- */
-public class DelimiterNotFoundException extends IOException {
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = -2002878162243872583L;
-    byte[] remainingBytes;
-    /**
-     * @param remainingBytes
-     */
-    public DelimiterNotFoundException(byte[] remainingBytes) {
-        super("Delimiter not found");
-        this.remainingBytes = remainingBytes;
-    }
-
-    /**
-     * @return Returns the remainingBytes.
-     */
-    public byte[] getRemainingBytes() {
-        return remainingBytes;
-    }
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    public String toString() {
-        try {
-            return  "The following "+remainingBytes.length+" bytes remain: "+new String(remainingBytes, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/FormFile.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/FormFile.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/FormFile.java
deleted file mode 100644
index c80ad08..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/FormFile.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright  2002-2006 WYMIWYG (http://wymiwyg.org)
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-/*
- * Teken from org.wymiwyg.wrhapi.util.parameterparse, adapted for integration in
- * JAX-RS by clerezza
- */
-package org.apache.clerezza.jaxrs.utils.form;
-
-import javax.ws.rs.core.MediaType;
-
-/**
- * Represents a file as contained in a multipart/form-data message
- * 
- * @author reto
- * 
- */
-public interface FormFile extends ParameterValue {
-
-    /**
-     * @return the content of the file
-     */
-    public byte[] getContent();
-
-    /**
-     * @return the filename provided by the sender or null if not supplied
-     */
-    public String getFileName();
-
-    /**
-     * @return the mime-type of the file
-     */
-    public MediaType getMediaType();
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/KeyValuePair.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/KeyValuePair.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/KeyValuePair.java
deleted file mode 100644
index cb34780..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/KeyValuePair.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.clerezza.jaxrs.utils.form;
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-/**
- * @author reto
- * @param <T>
- *            The type of the value
- * 
- */
-public class KeyValuePair<T> {
-    String key;
-    T value;
-
-    KeyValuePair(String key, T value) {
-        super();
-        this.key = key;
-        this.value = value;
-    }
-
-    /**
-     * @return the key
-     */
-    public String getKey() {
-        return key;
-    }
-
-    /**
-     * @return the value
-     */
-    public T getValue() {
-        return value;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartBody.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartBody.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartBody.java
deleted file mode 100644
index d265da6..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartBody.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright  2002-2004 WYMIWYG (www.wymiwyg.org)
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-package org.apache.clerezza.jaxrs.utils.form;
-
-/**
- * Represents a multipart/form-data message as specified by RFC 2388. It
- * currently supports only files and fields (text), as no implementation is
- * known to support file lists or external references
- * 
- * @author reto
- * 
- */
-public interface MultiPartBody extends ParameterCollection {
-
-    /**
-     * @return the file parameter names in the order they appear in the message
-     */
-    public abstract String[] getFileParameterNames();
-
-    /**
-     * @param name
-     *            the name of the parameter
-     * @return the values of the parameter
-     */
-    public abstract FormFile[] getFormFileParameterValues(String name);
-
-    /**
-     * @return all parameter names in the order they appear in the message
-     */
-    public abstract String[] getParameterNames();
-
-    /**
-     * @return the text parameter names in the order they appear in the message
-     */
-    public abstract String[] getTextParameterNames();
-
-    /**
-     * @param name
-     *            the name of the parameter
-     * @return the values of the parameter
-     */
-    public abstract String[] getTextParameterValues(String name);
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartBodyImpl.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartBodyImpl.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartBodyImpl.java
deleted file mode 100644
index 56ad575..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartBodyImpl.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright  2002-2004 WYMIWYG (www.wymiwyg.org)
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-package org.apache.clerezza.jaxrs.utils.form;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-
-/**
- * @author reto
- * 
- */
-public class MultiPartBodyImpl extends AbstractParameterCollection implements
-        MultiPartBody {
-
-    /**
-     * @author reto
-     * 
-     */
-    public static class FormFileImpl implements FormFile {
-
-        private byte[] content;
-        private String fileName;
-        private MediaType type;
-
-        /**
-         * @param fileName
-         * @param type
-         * @param content
-         */
-        public FormFileImpl(String fileName, MediaType type, byte[] content) {
-            this.type = type;
-            this.fileName = fileName;
-            this.content = content;
-        }
-
-        public byte[] getContent() {
-            return content;
-        }
-
-        /*
-         * (non-Javadoc)
-         * 
-         * @see org.wymiwyg.wrhapi.util.bodyparser.FormFile#getFileName()
-         */
-        public String getFileName() {
-            return fileName;
-        }
-
-        /*
-         * (non-Javadoc)
-         * 
-         * @see org.wymiwyg.wrhapi.util.bodyparser.FormFile#getMediaType()
-         */
-        public MediaType getMediaType() {
-            return type;
-        }
-
-    }
-
-    /**
-     * @author reto
-     * 
-     */
-    static class Disposition {
-
-        private String fileName;
-
-        private String name;
-
-        /**
-         * @param dispositionString
-         * @throws IOException
-         */
-        public Disposition(String dispositionString) throws IOException {
-            if (dispositionString == null) {
-                throw new RuntimeException(
-                        "No content-disposition string - contact your browser vendor");
-            }
-            StringTokenizer tokens = new StringTokenizer(dispositionString, ";");
-            while (tokens.hasMoreTokens()) {
-                String current = tokens.nextToken();
-                current = current.trim();
-                if (current.startsWith("name")) {
-                    name = readTokenValue(current);
-                } else {
-                    if (current.startsWith("filename")) {
-                        fileName = readTokenValue(current);
-                    }
-                }
-            }
-        }
-
-        /**
-         * @return
-         */
-        public String getFileName() {
-            return fileName;
-        }
-
-        /**
-         * @return
-         */
-        public String getName() {
-            return name;
-        }
-
-        /**
-         * returns teh value between "
-         * 
-         * @param current
-         * @return
-         */
-        private String readTokenValue(String token) throws IOException {
-            StringWriter out = new StringWriter();
-            StringReader in = new StringReader(token);
-            boolean inValueSection = false;
-            ;
-            for (int ch = in.read(); ch != -1; ch = in.read()) {
-                // assume " cannot be escaped in names
-                if (ch == '\"') {
-                    if (inValueSection) {
-                        return out.toString();
-                    } else {
-                        inValueSection = true;
-                    }
-                } else {
-                    if (inValueSection) {
-                        out.write(ch);
-                    }
-                }
-            }
-            throw new IOException("token-value not terminated with \"");
-        }
-
-    }
-
-    /**
-     * the maximum size of the parsed message-body
-     */
-    protected static int maxSize = 1024 * 1024 * 50; // 50MB
-
-    final static byte[] DOUBLE_LINE_BREAK = { 13, 10, 13, 10 };
-
-    final static byte[] LINE_BREAK = { 13, 10 };
-
-    final static Logger log = LoggerFactory.getLogger(MultiPartBodyImpl.class);
-
-    private static String getBoundary(MediaType type) {
-        String boundary = type.getParameters().get("boundary");
-
-        if (boundary == null) {
-            throw new RuntimeException("boundary is not set");
-        }
-        return boundary;
-    }
-
-
-    // private List<KeyValuePair<ParameterValue>> rawCollection= new
-    // ArrayList<KeyValuePair<ParameterValue>>();
-
-    private List<KeyValuePair<FormFile>> formFiles = new ArrayList<KeyValuePair<FormFile>>();
-
-    private List<KeyValuePair<String>> formTexts = new ArrayList<KeyValuePair<String>>();
-
-    List<String> allFieldNames = new ArrayList<String>();
-
-    /**
-     * creates a MultiPartBody by parsing a stream
-     * 
-     * @param rawIn
-     * @param boundary
-     *            the boundary-string delimiting the parts
-     * @throws HandlerException
-     */
-    public MultiPartBodyImpl(final InputStream rawIn, final String boundary)
-            throws IOException {
-        rawCollection = new ArrayList<KeyValuePair<ParameterValue>>();
-        DelimiterInputStream in = new DelimiterInputStream(rawIn);
-        ByteArrayOutputStream delimiterBaos = new ByteArrayOutputStream();
-        delimiterBaos.write(45);// dash
-        delimiterBaos.write(45);
-        delimiterBaos.write(boundary.getBytes("utf-8"));
-        byte[] delimiter = delimiterBaos.toByteArray();
-        in.readTill(delimiter);
-        in.read(); // 13
-        in.read(); // 10
-        delimiterBaos = new ByteArrayOutputStream();
-        delimiterBaos.write(LINE_BREAK);
-        delimiterBaos.write(delimiter);
-        readFields(in, delimiterBaos.toByteArray());
-        // from rfc 2616: a bare CR
-        // or LF MUST NOT be substituted for CRLF within any of the HTTP
-        // control
-        // structures (such as header fields and multipart boundaries)
-        // this means we are strict in expecting CRLF
-    }
-
-    /**
-     * Creates a MultiPartBody from the InputStream of the body and the MediaType
-     * 
-     * @param rawIn
-     * @param type
-     * @throws HandlerException
-     */
-    public MultiPartBodyImpl(final InputStream rawIn, final MediaType type)
-            throws IOException {
-        this(rawIn, getBoundary(type));
-    }
-
-
-    public String[] getFileParameterNames() {
-        String[] result = new String[formFiles.size()];
-        int i = 0;
-        for (KeyValuePair<FormFile> keyValue : formFiles) {
-            result[i++] = keyValue.key;
-        }
-        return result;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.wymiwyg.wrhapi.util.bodyparser.MultiPartBody#getFormFileParameterValues(java.lang.String)
-     */
-    public FormFile[] getFormFileParameterValues(String name) {
-        List<FormFile> values = new ArrayList<FormFile>();
-        for (KeyValuePair<FormFile> keyValue : formFiles) {
-            if (keyValue.key.equals(name)) {
-                values.add(keyValue.value);
-            }
-        }
-        return values.toArray(new FormFile[values.size()]);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.wymiwyg.wrhapi.util.bodyparser.MultiPartBody#getParameterNames()
-     */
-    public String[] getParameterNames() {
-        return allFieldNames.toArray(new String[allFieldNames.size()]);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.wymiwyg.wrhapi.util.bodyparser.MultiPartBody#getTextParameterNames()
-     */
-    public String[] getTextParameterNames() {
-        String[] result = new String[formTexts.size()];
-        int i = 0;
-        for (KeyValuePair<String> keyValue : formTexts) {
-            result[i++] = keyValue.key;
-        }
-        return result;
-    }
-
-    public String[] getTextParameterValues(String name) {
-        List<String> values = new ArrayList<String>();
-        for (KeyValuePair<String> keyValue : formTexts) {
-            if (keyValue.key.equals(name)) {
-                values.add(keyValue.value);
-            }
-        }
-        return values.toArray(new String[values.size()]);
-    }
-
-    @Override
-    public Iterator<KeyValuePair<ParameterValue>> iterator() {
-        return rawCollection.iterator();
-    }
-
-    /**
-     * @param result
-     * @param disposition
-     * @param string
-     * @param data
-     * @throws IOException
-     */
-    private void addFileField(Disposition disposition, String mediaTypeString,
-            byte[] data) throws IOException {
-        String name = disposition.getName();
-            rawCollection.add(new KeyValuePair<ParameterValue>(name,
-                    new FormFileImpl(disposition.getFileName(), MediaType.valueOf(
-                            mediaTypeString), data)));
-            formFiles.add(new KeyValuePair<FormFile>(name, new FormFileImpl(
-                    disposition.getFileName(), MediaType.valueOf(
-                            mediaTypeString), data)));
-
-    }
-
-    /**
-     * @param result
-     * @param disposition
-     * @param data
-     */
-    private void addTextField(Disposition disposition, byte[] data) {
-        String name = disposition.getName();
-        try {
-            rawCollection.add(new KeyValuePair<ParameterValue>(name,
-                    new StringParameterValue(new String(data, "utf-8"))));
-            formTexts.add(new KeyValuePair<String>(name, new String(data,
-                    "utf-8")));
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
-
-    }
-
-    /**
-     * @param in
-     * @param bs
-     * @return
-     * @throws IOException
-     * @throws IOException
-     */
-    private void readFields(DelimiterInputStream in, byte[] delimiter)
-            throws IOException {
-        while (true) {
-            Map<String, String> partHeaders;
-            partHeaders = readHeaders(in);
-
-            String dispositionString = (String) partHeaders
-                    .get("content-disposition");
-            byte[] data;
-            data = in.readTill(delimiter);
-
-            Disposition disposition = new Disposition(dispositionString);
-            allFieldNames.add(disposition.name);
-            if (disposition.getFileName() != null) {
-                addFileField(disposition, (String) partHeaders
-                        .get(HttpHeaders.CONTENT_TYPE.toLowerCase(Locale.ENGLISH)).trim(), data);
-            } else {
-                addTextField(disposition, data);
-            }
-            byte[] twoBytes = new byte[2];
-            in.read(twoBytes);
-            if (twoBytes[0] == '-') {
-                // the terminating two dashed (instead of CRLF
-                break;
-            }
-        }
-
-    }
-
-    /**
-     * 
-     * This reads the headers, it stops after having read CRLFCRLF
-     * The keys in the Map are lower case strings
-     *
-     * @param in
-     * @return
-     * @throws
-     * @throws IOException
-     */
-    private Map<String, String> readHeaders(DelimiterInputStream in)
-            throws IOException {
-        Map<String, String> result = new HashMap<String, String>();
-        for (byte[] line = in.readTill(LINE_BREAK); line.length > 0; line = in
-                .readTill(LINE_BREAK)) {
-            String string = new String(line, "utf-8");
-            int colonPos = string.indexOf(':');
-            if (colonPos == -1) {
-                log.error("Header conatins no colon: " + string);
-                continue;
-            }
-            int startPos = 0;
-            while ((string.charAt(startPos) == '\n')
-                    || (string.charAt(startPos) == '\r')) {
-                startPos++;
-            }
-            String headerName = string.substring(startPos, colonPos)
-                    .toLowerCase(Locale.ENGLISH);
-
-            String value = string.substring(colonPos + 1);
-            result.put(headerName, value);
-        }
-        return result;
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartFormMessageBodyReader.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartFormMessageBodyReader.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartFormMessageBodyReader.java
deleted file mode 100644
index a6ba7a1..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/MultiPartFormMessageBodyReader.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.clerezza.jaxrs.utils.form;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
-
-/**
- * This JAX-RS provider converts a request body of the content type
- * "multipart/form-data" (format according RFC 2388) into a
- * <code>MultiPartBody</code> object.
- * 
- */
-@Component
-@Service(Object.class)
-@Property(name="javax.ws.rs", boolValue=true)
-@Provider
-@Consumes("multipart/form-data")
-public class MultiPartFormMessageBodyReader implements
-        MessageBodyReader<MultiPartBody> {
-
-    @Override
-    public boolean isReadable(Class<?> type, Type genericType,
-            Annotation[] annotations, MediaType mediaType) {
-        return type.isAssignableFrom(MultiPartBody.class) 
-                && mediaType.getType().equals("multipart") 
-                && mediaType.getSubtype().equals("form-data");
-    }
-
-    @Override
-    public MultiPartBody readFrom(Class<MultiPartBody> type, Type genericType,
-            Annotation[] annotations, MediaType mediaType,
-            MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
-            throws IOException, WebApplicationException {
-        return new MultiPartBodyImpl(entityStream, mediaType);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/ParameterCollection.java
----------------------------------------------------------------------
diff --git a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/ParameterCollection.java b/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/ParameterCollection.java
deleted file mode 100644
index 83bc552..0000000
--- a/jaxrs.utils/src/main/java/org/apache/clerezza/jaxrs/utils/form/ParameterCollection.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright  2002-2006 WYMIWYG (http://wymiwyg.org)
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-package org.apache.clerezza.jaxrs.utils.form;
-
-/**
- * @author reto
- * 
- */
-public interface ParameterCollection extends
-        java.util.Collection<KeyValuePair<ParameterValue>> {
-
-    /**
-     * @return the parameter names in the order they first appear in the request
-     */
-    public String[] getParameterNames();
-
-    /**
-     * 
-     * @param parameterName
-     *            the name of the parameter
-     * @return an array with the values of the parameter or null if the
-     *         parameter is not present
-     */
-    public ParameterValue[] getParameteValues(String parameterName);
-
-}


Mime
View raw message