Remove URI-based conneg feature and associated APIs

svn path=/trunk/; revision=417
diff --git a/spec/chapters/resources.tex b/spec/chapters/resources.tex
index b121e30..21e6322 100644
--- a/spec/chapters/resources.tex
+++ b/spec/chapters/resources.tex
@@ -307,77 +307,12 @@
 \subsection{Request Preprocessing}
 \label{reqpreproc}
 
-Prior to matching, request URIs are preprocessed to support URI-based content negotiation as follows:
-
-\begin{enumerate}
-\item Normalize the request URI\footnote{Note: some containers might perform this functionality prior to passing the request to an implementation.} by following the rules for case, path segment, and percent encoding normalization described in section 6.2.2 of RFC 3986\cite{uri}.
-\item Set
-\begin{itemize}
-\item $M = \{\mbox{\code{config.getMediaTypeMappings().keySet()}}\}$
-\item $L = \{\mbox{\code{config.getLanguageMappings().keySet()}}\}$
-\item $m = \mbox{\code{null}}$
-\item $l = \mbox{\code{null}}$
-\item Where \code{config} is an instance of the application-supplied subclass of \code{Application}.
-\end{itemize}
-\item For each extension (a \lq.\rq\ character followed by one or more alphanumeric characters) $e$ in the final path segment scanning from right to left:
-\begin{enumerate}
-\item Remove the leading \lq.\rq\ character from $e$
-\item\label{removematchingext1} If $m$ is \code{null} and $e$ is a member of $M$ then remove the corresponding extension from the effective request URI and set $m=e$.
-\item\label{removematchingext2} Else if $l$ is \code{null} and $e$ is a member of $L$ then remove the corresponding extension from the effective request URI and set $l=e$.
-\item Else go to step \ref{replaceheaders}
-\end{enumerate}
-\item\label{replaceheaders} If $m$ is not \code{null} then set the value of the \code{Accept} header to \code{config\-.get\-Extension\-Mappings()\-.get($m$)}
-\item If $l$ is not \code{null} then set the value of the \code{Accept-Language} header to \code{config\-.get\-Language\-Mappings()\-.get($l$)}
-\end{enumerate}
-
-The following table illustrates the preprocessing algorithm for a request with the following initial header values: 
-\begin{description}
-\item[\code{Accept}] \code{text/html}
-\item[\code{Accept-Language}] \code{fr}
-\end{description}
-
-Also assumed is an \code{Application} subclass with the following mappings:
-\begin{description}
-\item[Media Type] $\mbox{\lq\lq xml\rq\rq}\Rightarrow\mbox{\lq\lq application/xml\rq\rq}$; $\mbox{\lq\lq json\rq\rq}\Rightarrow\mbox{\lq\lq application/json\rq\rq}$
-\item[Language] $\mbox{\lq\lq en\rq\rq}\Rightarrow\mbox{\lq\lq en-US\rq\rq}$; $\mbox{\lq\lq de\rq\rq}\Rightarrow\mbox{\lq\lq de\rq\rq}$
-\end{description}
-
-\begin{longtable}{|l|l|l|l|}
-\hline
-\bfseries Request URI & \bfseries Effective URI & \bfseries Accept  & \bfseries Accept-Language 
-\tabularnewline
-\hline\hline\endhead
-foo & foo & text/html & fr \tabularnewline
-\hline
-foo.bar & foo.bar & text/html & fr \tabularnewline
-\hline
-foo.xml & foo & application/xml & fr \tabularnewline
-\hline
-foo.bar.xml & foo.bar & application/xml & fr \tabularnewline
-\hline
-foo.xml.bar & foo.xml.bar & text/html & fr \tabularnewline
-\hline
-foo.en.xml & foo & application/xml & en-US \tabularnewline
-\hline
-foo.xml.en & foo & application/xml & en-US \tabularnewline
-\hline
-foo.json.xml & foo.json & application/xml & fr \tabularnewline
-\hline
-foo.xml.json & foo.xml & application/json & fr \tabularnewline
-\hline
-foo.xml.en.json.de & foo.xml.en & application/json & de \tabularnewline
-\hline
-foo.xml.en.json.de.bar & foo.xml.en.json.de.bar & text/html & fr \tabularnewline
-\hline
-\caption{URI-based Content Negotiation Examples}
-\end{longtable}
-
-The above preprocessing MUST be reflected in the URIs obtained from an injected \code{UriInfo}, in particular extensions removed in steps \ref{removematchingext1} and \ref{removematchingext2} above MUST not be present in URIs returned from the methods of \UriInfo. Similarly, the methods of \HttpHeaders\ MUST return the preprocessed values of the \code{Accept} and \code{Accept-Language} headers rather than the original values supplied with the request.
+Prior to matching, request URIs are normalized\footnote{Note: some containers might perform this functionality prior to passing the request to an implementation.} by following the rules for case, path segment, and percent encoding normalization described in section 6.2.2 of RFC 3986\cite{uri}. The normalized request URI MUST be reflected in the URIs obtained from an injected \code{UriInfo}.
 
 \subsection{Request Matching}
 \label{request_matching}
 
-A request is matched to the corresponding resource method or sub-resource method by comparing the effective request URI (see section \ref{reqpreproc}), the media type of any request entity, and the requested response entity format to the metadata annotations on the resource classes and their methods. If no matching resource method or sub-resource method can be found then an appropriate error response is returned. Matching of requests to resource methods proceeds in three stages as follows:
+A request is matched to the corresponding resource method or sub-resource method by comparing the normalized request URI (see section \ref{reqpreproc}), the media type of any request entity, and the requested response entity format to the metadata annotations on the resource classes and their methods. If no matching resource method or sub-resource method can be found then an appropriate error response is returned. Matching of requests to resource methods proceeds in three stages as follows:
 
 \begin{enumerate}
 \item Identify the root resource class:
diff --git a/src/jsr311-api/src/javax/ws/rs/core/UriBuilder.java b/src/jsr311-api/src/javax/ws/rs/core/UriBuilder.java
index fc7476f..61784b1 100644
--- a/src/jsr311-api/src/javax/ws/rs/core/UriBuilder.java
+++ b/src/jsr311-api/src/javax/ws/rs/core/UriBuilder.java
@@ -320,39 +320,6 @@
     public abstract UriBuilder path(Method... methods) throws IllegalArgumentException;
     
     /**
-     * Set the extension that will be appended to the final path segment at
-     * build time. An initial "." will be appended if necessary. If the final
-     * path segment already contains an extension, it will be retained and the
-     * supplied extension will be appended to it as a new extension. E.g.:
-     * 
-     * <ul>
-     * <li><code>UriBuilder.fromPath("foo").extension("bar").build()</code> 
-     * returns "foo.bar".</li>
-     * <li><code>UriBuilder.fromPath("foo.baz").extension("bar").build()</code> 
-     * returns "foo.baz.bar".</li>
-     * <li><code>UriBuilder.fromPath("foo").extension("bar").path(baz).build()</code> 
-     * returns "foo/baz.bar".</li>
-     * </ul>
-     * 
-     * <p>Note that the extension will be appended to the path component, 
-     * matrix and query parameters will follow any appended extension.</p>
-     * 
-     * @param extension the extension to append at build time, a null value
-     * will result in no extension being appended.
-     * @return the updated UriBuilder
-     */
-    public abstract UriBuilder extension(String extension);
-    
-    /**
-     * Get the current value of the extension that will be appended to the 
-     * final path segment at build time.
-     * @return the extension that will be appended to the final path segment at
-     * build time
-     * @see #extension(java.lang.String) 
-     */
-    public abstract String getExtension();
-    
-    /**
      * Set the matrix parameters of the current final segment of the current URI path.
      * This method will overwrite any existing matrix parameters on the current final
      * segment of the current URI path. Note that the matrix parameters
diff --git a/src/jsr311-api/src/javax/ws/rs/core/UriInfo.java b/src/jsr311-api/src/javax/ws/rs/core/UriInfo.java
index c4c97fc..a5cf044 100644
--- a/src/jsr311-api/src/javax/ws/rs/core/UriInfo.java
+++ b/src/jsr311-api/src/javax/ws/rs/core/UriInfo.java
@@ -31,12 +31,6 @@
  * {@link #getBaseUriBuilder} throw <code>java.lang.IllegalStateException</code>
  * if called outside the scope of a request (e.g. from a provider constructor).</p>
  * 
- * <p>Note that the URIs obtained from the methods of this interface provide
- * access to request URIs after URI-based content negotiation preprocessing. E.g.
- * if the request URI is "foo.xml" and {@link Application#getMediaTypeMappings()}
- * includes a mapping for "xml", then {@link #getPath()} will return "foo", not
- * "foo.xml". The removed "xml" extension is available via {@link #getConnegExtension}.</p>
- * 
  * @see Context
  * @see Application#getLanguageMappings() 
  * @see Application#getMediaTypeMappings() 
@@ -103,12 +97,9 @@
     public URI getRequestUri();
     
     /**
-     * Get the absolute request URI in the form of a UriBuilder. The returned 
-     * builder will have its extension initialized with 
-     * <code>extension(getConnegExtension())</code>.
+     * Get the absolute request URI in the form of a UriBuilder.
      * @return a UriBuilder initialized with the absolute request URI
      * @throws java.lang.IllegalStateException if called outside the scope of a request
-     * @see UriBuilder#extension(java.lang.String) 
      */
     public UriBuilder getRequestUriBuilder();
     
@@ -125,45 +116,26 @@
     /**
      * Get the absolute path of the request in the form of a UriBuilder.
      * This includes everything preceding the path (host, port etc) but excludes
-     * query parameters and fragment. The returned builder will have its 
-     * extension initialized with <code>extension(getConnegExtension())</code>.
+     * query parameters and fragment.
      * @return a UriBuilder initialized with the absolute path of the request
      * @throws java.lang.IllegalStateException if called outside the scope of a request
-     * @see UriBuilder#extension(java.lang.String) 
      */
     public UriBuilder getAbsolutePathBuilder();
 
     /**
-     * Get the base URI of the application. URIs of resource beans
+     * Get the base URI of the application. URIs of root resource classes
      * are all relative to this base URI.
      * @return the base URI of the application
      */
     public URI getBaseUri();
     
     /**
-     * Get the base URI of the application in the form of a UriBuilder. If
-     * called within the scope of a request, the builder will have its extension
-     * initialized with <code>extension(getConnegExtension())</code>.
+     * Get the base URI of the application in the form of a UriBuilder.
      * @return a UriBuilder initialized with the base URI of the application.
-     * @see UriBuilder#extension(java.lang.String) 
      */
     public UriBuilder getBaseUriBuilder();
     
     /**
-     * Get the request URI extension that was removed during URI-based content
-     * negotiation preprocessing. The extension does not include the leading "."
-     * nor any matrix parameters that might be present after the extension.
-     * E.g. if the request URI is "foo.xml" and 
-     * {@link Application#getMediaTypeMappings()} includes a mapping for
-     * "xml", then this method will return "xml". Note that the extension might
-     * include both a media type and language extension, e.g. "xml.en", if
-     * both are in use.
-     * @return the URI extension that was removed during URI-based content
-     * negotiation preprocessing or null if nothing was removed
-     */
-    public String getConnegExtension();
-    
-    /**
      * Get the values of any embedded URI template parameters.
      * All sequences of escaped octets are decoded,
      * equivalent to <code>getPathParameters(true)</code>.