http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/overview-summary.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/overview-summary.html b/content/site/apidocs/overview-summary.html index 1f5dadb..50b7e28 100644 --- a/content/site/apidocs/overview-summary.html +++ b/content/site/apidocs/overview-summary.html @@ -3378,106 +3378,123 @@ <jd>/** Example GET request that redirects to our example method */</jd> <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/"</js>) - <jk>public</jk> Redirect doGetExample() <jk>throws</jk> Exception { - <jk>return new</jk> Redirect(<js>"example1/xxx/123/{0}/xRemainder?p1=123&p2=yyy"</js>, UUID.<jsm>randomUUID</jsm>()); + <jk>public</jk> Redirect doExample() <jk>throws</jk> Exception { + <jk>return new</jk> Redirect(<js>"example1/xxx/123/{0}/xRemainder?q1=123&q2=yyy"</js>, UUID.<jsm>randomUUID</jsm>()); } - <jd>/** Example GET request using annotated attributes */</jd> - <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/example1/{a1}/{a2}/{a3}/*"</js>, rc={200}) - <jk>public</jk> String doGetExample1( - <ja>@Method</ja> String method, - <ja>@Path</ja> String a1, - <ja>@Path</ja> <jk>int</jk> a2, - <ja>@Path</ja> UUID a3, - <ja>@Query</ja>(<js>"p1"</js>) <jk>int</jk> p1, - <ja>@Query</ja>(<js>"p2"</js>) String p2, - <ja>@Query</ja>(<js>"p3"</js>) UUID p3, - <ja>@PathRemainder</ja> String remainder, - <ja>@Header</ja>(<js>"Accept-Language"</js>) String lang, - <ja>@Header</ja>(<js>"Accept"</js>) String accept, - <ja>@Header</ja>(<js>"DNT"</js>) <jk>int</jk> doNotTrack - ) { - String output = String.format( - <js>"method=%s, a1=%s, a2=%d, a3=%s, remainder=%s, p1=%d, p2=%s, p3=%s, lang=%s, accept=%s, dnt=%d"</js>, - method, a1, a2, a3, remainder, p1, p2, p3, lang, accept, doNotTrack); - <jk>return</jk> output; - } - - <jd>/** Example GET request using methods on RestRequest and RestResponse */</jd> - <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/example2/{a1}/{a2}/{a3}/*"</js>, rc={200}) - <jk>public void</jk> doGetExample2(RestRequest req, RestResponse res) <jk>throws</jk> Exception { - String method = req.getMethod(); - - <jc>// Attributes (from URL pattern variables)</jc> - RequestPathParams path = req.getPathParams(); - String a1 = path.get(<js>"a1"</js>, String.<jk>class</jk>); - <jk>int</jk> a2 = path.get(<js>"a2"</js>, <jk>int</jk>.<jk>class</jk>); - UUID a3 = path.get(<js>"a3"</js>, UUID.<jk>class</jk>); + <jd>/** + * Methodology #1 - GET request using annotated attributes. + * This approach uses annotated parameters for retrieving input. + */</jd> + <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/example1/{p1}/{p2}/{p3}/*"</js>) + <jk>public</jk> String example1( + <ja>@Method</ja> String method, <jc>// HTTP method.</jc> + <ja>@Path</ja> String p1, <jc>// Path variables.</jc> + <ja>@Path</ja> <jk>int</jk> p2, + <ja>@Path</ja> UUID p3, + <ja>@Query</ja>(<js>"q1"</js>) <jk>int</jk> q1, <jc>// Query parameters.</jc> + <ja>@Query</ja>(<js>"q2"</js>) String q2, + <ja>@Query</ja>(<js>"q3"</js>) UUID q3, + <ja>@PathRemainder</ja> String remainder, <jc>// Path remainder after pattern match.</jc> + <ja>@Header</ja>(<js>"Accept-Language"</js>) String lang, <jc>// Headers.</jc> + <ja>@Header</ja>(<js>"Accept"</js>) String accept, + <ja>@Header</ja>(<js>"DNT"</js>) <jk>int</jk> doNotTrack + ) { + + <jc>// Send back a simple String response</jc> + String output = String.<jsm>format</jsm>( + <js>"method=%s, p1=%s, p2=%d, p3=%s, remainder=%s, q1=%d, q2=%s, q3=%s, lang=%s, accept=%s, dnt=%d"</js>, + method, p1, p2, p3, remainder, q1, q2, q3, lang, accept, doNotTrack); + <jk>return</jk> output; + } + + <jd>/** + * Methodology #2 - GET request using methods on RestRequest and RestResponse. + * This approach uses low-level request/response objects to perform the same as above. + */</jd> + <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/example2/{p1}/{p2}/{p3}/*"</js>) + <jk>public</jk> String example2( + RestRequest req, <jc>// A direct subclass of HttpServletRequest.</jc> + RestResponse res <jc>// A direct subclass of HttpServletResponse.</jc> + ) { - <jc>// Optional GET parameters</jc> + <jc>// HTTP method.</jc> + String method = req.getMethod(); + + <jc>// Path variables.</jc> + RequestPathMatch path = req.getPathMatch(); + String p1 = path.get(<js>"p1"</js>, String.<jk>class</jk>); + <jk>int</jk> p2 = path.get(<js>"p2"</js>, <jk>int</jk>.<jk>class</jk>); + UUID p3 = path.get(<js>"p3"</js>, UUID.<jk>class</jk>); + + <jc>// Query parameters.</jc> RequestQuery query = req.getQuery(); - <jk>int</jk> p1 = query.get(<js>"p1"</js>, <jk>int</jk>.<jk>class</jk>, 0); - String p2 = query.get(<js>"p2"</js>, String.<jk>class</jk>); - UUID p3 = query.get(<js>"p3"</js>, UUID.<jk>class</jk>); - - <jc>// URL pattern post-match</jc> - String remainder = req.getPathRemainder(); - - <jc>// Headers</jc> - String lang = req.getHeader(<js>"Accept-Language"</js>); - <jk>int</jk> doNotTrack = req.getHeader(<js>"DNT"</js>, <jk>int</jk>.<jk>class</jk>); - - <jc>// Send back a simple String response</jc> - String output = String.format( - <js>"method=%s, a1=%s, a2=%d, a3=%s, remainder=%s, p1=%d, p2=%s, p3=%s, lang=%s, dnt=%d"</js>, - method, a1, a2, a3, remainder, p1, p2, p3, lang, doNotTrack); - res.setOutput(output); - } + <jk>int</jk> q1 = query.get(<js>"q1"</js>, 0, <jk>int</jk>.<jk>class</jk>); + String q2 = query.get(<js>"q2"</js>, String.<jk>class</jk>); + UUID q3 = query.get(<js>"q3"</js>, UUID.<jk>class</jk>); + + <jc>// Path remainder after pattern match.</jc> + String remainder = req.getPathMatch().getRemainder(); + + <jc>// Headers.</jc> + String lang = req.getHeader(<js>"Accept-Language"</js>); + String accept = req.getHeader(<js>"Accept"</js>); + <jk>int</jk> doNotTrack = req.getHeaders().get(<js>"DNT"</js>, <jk>int</jk>.<jk>class</jk>); + + <jc>// Send back a simple String response</jc> + String output = String.format( + <js>"method=%s, p1=%s, p2=%d, p3=%s, remainder=%s, q1=%d, q2=%s, q3=%s, lang=%s, accept=%s, dnt=%d"</js>, + method, p1, p2, p3, remainder, q1, q2, q3, lang, accept, doNotTrack); + res.setOutput(output); <jc>// Or use getWriter().</jc> + } - <jd>/** Example GET request using resolved parameter objects */</jd> - <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/example3/{a1}/{a2}/{a3}/*"</js>, rc={200}) - <jk>public void</jk> doGetExample3( - HttpMethod httpMethod, - RequestPathParams path, - RequestQuery query, - <ja>@PathRemainder</ja> String remainder, - AcceptLanguage acceptLanguage, - Accept accept, - DNT dnt - ) <jk>throws</jk> Exception { - - String method = httpMethod.toString(); - - <jc>// Attributes (from URL pattern variables)</jc> - String a1 = path.get(<js>"a1"</js>, String.<jk>class</jk>); - <jk>int</jk> a2 = path.get(<js>"a2"</js>, <jk>int</jk>.<jk>class</jk>); - UUID a3 = path.get(<js>"a3"</js>, UUID.<jk>class</jk>); - - <jc>// Optional GET parameters</jc> - <jk>int</jk> p1 = query.get(<js>"p1"</js>, <jk>int</jk>.<jk>class</jk>, 0); - String p2 = query.get(<js>"p2"</js>, String.<jk>class</jk>); - UUID p3 = query.get(<js>"p3"</js>, UUID.<jk>class</jk>); - - <jc>// Headers</jc> - String lang = acceptLanguage.toString(); - <jk>int</jk> doNotTrack = dnt.asType(<jk>int</jk>.<jk>class</jk>); + <jd>/** + * Methodology #3 - GET request using special objects. + * This approach uses intermediate-level APIs. + * The framework recognizes the parameter types and knows how to resolve them. + */</jd> + <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/example3/{p1}/{p2}/{p3}/*"</js>) + <jk>public</jk> String example3( + HttpMethod method, <jc>// HTTP method.</jc> + RequestPathMatch path, <jc>// Path variables.</jc> + RequestQuery query, <jc>// Query parameters.</jc> + RequestHeaders headers, <jc>// Headers.</jc> + AcceptLanguage lang, <jc>// Specific header classes.</jc> + Accept accept + ) { - <jc>// Send back a simple String response</jc> - String output = String.format( - <js>"method=%s, a1=%s, a2=%d, a3=%s, remainder=%s, p1=%d, p2=%s, p3=%s, lang=%s, dnt=%d"</js>, - method, a1, a2, a3, remainder, p1, p2, p3, lang, doNotTrack); - res.setOutput(output); - } - } + <jc>// Path variables.</jc> + String p1 = path.get(<js>"p1"</js>, String.<jk>class</jk>); + <jk>int</jk> p2 = path.get(<js>"p2"</js>, <jk>int</jk>.<jk>class</jk>); + UUID p3 = path.get(<js>"p3"</js>, UUID.<jk>class</jk>); + + <jc>// Query parameters.</jc> + <jk>int</jk> q1 = query.get(<js>"q1"</js>, 0, <jk>int</jk>.<jk>class</jk>); + String q2 = query.get(<js>"q2"</js>, String.<jk>class</jk>); + UUID q3 = query.get(<js>"q3"</js>, UUID.<jk>class</jk>); + + <jc>// Path remainder after pattern match.</jc> + String remainder = path.getRemainder(); + + <jc>// Headers.</jc> + int doNotTrack = headers.get(<js>"DNT"</js>, <jk>int</jk>.<jk>class</jk>); + + <jc>// Send back a simple String response</jc> + String output = String.format( + <js>"method=%s, p1=%s, p2=%d, p3=%s, remainder=%s, q1=%d, q2=%s, q3=%s, lang=%s, accept=%s, dnt=%d"</js>, + method, p1, p2, p3, remainder, q1, q2, q3, lang, accept, doNotTrack); + res.setOutput(output); + } + } </p> <p> The class consists of 4 methods: </p> <ul class='javahierarchy'> - <li class='m'><l>doGetExample()</l> + <li class='m'><l>doExample()</l> <br>The root page. <br>Performs a simple redirection to the <l>doGetExample1()</l> method using a <a href="org/apache/juneau/rest/Redirect.html" title="class in org.apache.juneau.rest"><code>Redirect</code></a> object. - <li class='m'><l>doGetExample1()</l> + <li class='m'><l>example1()</l> <br>Shows how to use the following annotations: <ul> <li class='n'><a href="org/apache/juneau/rest/annotation/Path.html" title="annotation in org.apache.juneau.rest.annotation"><code>@Path</code></a> @@ -3487,18 +3504,18 @@ <li class='n'><a href="org/apache/juneau/rest/annotation/PathRemainder.html" title="annotation in org.apache.juneau.rest.annotation"><code>@PathRemainder</code></a> </ul> Method returns a POJO to be serialized as the output. - <li class='m'><l>doGetExample2()</l> + <li class='m'><l>example2()</l> <br>Identical to <l>doGetExample1()</l> but shows how to use the <a href="org/apache/juneau/rest/RestRequest.html" title="class in org.apache.juneau.rest"><code>RestRequest</code></a> and <a href="org/apache/juneau/rest/RestResponse.html" title="class in org.apache.juneau.rest"><code>RestResponse</code></a> objects: <ul> - <li class='m'><a href="org/apache/juneau/rest/RestRequest.html#getPathParams--"><code>RestRequest.getPathParams()</code></a> + <li class='m'><a href="org/apache/juneau/rest/RestRequest.html#getPathMatch--"><code>RestRequest.getPathMatch()</code></a> <li class='m'><a href="org/apache/juneau/rest/RestRequest.html#getQuery--"><code>RestRequest.getQuery()</code></a> <li class='m'><a href="org/apache/juneau/rest/RestRequest.html#getFormData--"><code>RestRequest.getFormData()</code></a> <li class='m'><a href="org/apache/juneau/rest/RestRequest.html#getHeaders--"><code>RestRequest.getHeaders()</code></a> <li class='m'><a href="org/apache/juneau/rest/RestRequest.html#getMethod--"><code>RestRequest.getMethod()</code></a> - <li class='m'><a href="org/apache/juneau/rest/RestRequest.html#getPathRemainder--"><code>RestRequest.getPathRemainder()</code></a> + <li class='m'><a href="org/apache/juneau/rest/RequestPathMatch.html#getRemainder--"><code>RequestPathMatch.getRemainder()</code></a> </ul> Method sets the POJO to be serialized using the <a href="org/apache/juneau/rest/RestResponse.html#setOutput-java.lang.Object-"><code>RestResponse.setOutput(Object)</code></a> method. - <li class='m'><l>doGetExample2()</l> + <li class='m'><l>example3()</l> <br>Identical to <l>doGetExample1()</l> but uses automatically resolved parameters based on class type. <br>Juneau automatically recognizes specific class types such as common header types and automatically resolves them to objects for you. @@ -4455,14 +4472,13 @@ <ja>@RestMethod</ja>(name=<js>"PUT"</js>, path=<js>"/people/{id}/*"</js>, guards=AdminGuard.<jk>class</jk> ) - <jk>public</jk> String updatePerson(RestRequest req, <ja>@Path</ja> <jk>int</jk> id) <jk>throws</jk> Exception { + <jk>public</jk> String updatePerson(RestRequest req, <ja>@Path</ja> <jk>int</jk> id, <ja>@PathRemainder</ja> String remainder) <jk>throws</jk> Exception { <jk>try</jk> { Person p = findPerson(id); - String pathRemainder = req.getPathRemainder(); PojoRest r = <jk>new</jk> PojoRest(p); - ClassMeta<?> cm = r.getClassMeta(pathRemainder); - Object in = req.getBody(cm); - r.put(pathRemainder, in); + ClassMeta<?> cm = r.getClassMeta(remainder); + Object in = req.getBody().asType(cm); + r.put(remainder, in); <jk>return</jk> <js>"PUT successful"</js>; } <jk>catch</jk> (Exception e) { <jk>throw new</jk> RestException(<jsf>SC_BAD_REQUEST</jsf>, <js>"PUT unsuccessful"</js>).initCause(e); @@ -4476,14 +4492,13 @@ <ja>@RestMethod</ja>(name=<js>"PUT"</js>, path=<js>"/addresses/{id}/*"</js>, guards=AdminGuard.<jk>class</jk> ) - <jk>public</jk> String updateAddress(RestRequest req, <ja>@Path</ja> <jk>int</jk> id) <jk>throws</jk> Exception { + <jk>public</jk> String updateAddress(RestRequest req, <ja>@Path</ja> <jk>int</jk> id, <ja>@PathRemainder</ja> String remainder) <jk>throws</jk> Exception { <jk>try</jk> { Address a = findAddress(id); - String pathInfo = req.getPathInfo(); PojoRest r = <jk>new</jk> PojoRest(a); - ClassMeta<?> cm = r.getClassMeta(pathInfo); - Object in = req.getBody(cm); - r.put(pathInfo, in); + ClassMeta<?> cm = r.getClassMeta(remainder); + Object in = req.getBody().asType(cm); + r.put(remainder, in); <jk>return</jk> <js>"PUT successful"</js>; } <jk>catch</jk> (Exception e) { <jk>throw new</jk> RestException(<jsf>SC_BAD_REQUEST</jsf>, <js>"PUT unsuccessful"</js>).initCause(e); @@ -6321,7 +6336,7 @@ <li><a href="org/apache/juneau/rest/RestRequest.html#getHeaders--"><code>RestRequest.getHeaders()</code></a> - The request headers. <li><a href="org/apache/juneau/rest/RestRequest.html#getQuery--"><code>RestRequest.getQuery()</code></a> - The request query parameters. <li><a href="org/apache/juneau/rest/RestRequest.html#getFormData--"><code>RestRequest.getFormData()</code></a> - The request form data parameters. - <li><a href="org/apache/juneau/rest/RestRequest.html#getPathParams--"><code>RestRequest.getPathParams()</code></a> - The path variables. + <li><a href="org/apache/juneau/rest/RestRequest.html#getPathMatch--"><code>RestRequest.getPathMatch()</code></a> - The path variables and remainder. </ul> The following classes have been introduced: <ul> @@ -6329,7 +6344,7 @@ <li><a href="org/apache/juneau/rest/RequestHeaders.html" title="class in org.apache.juneau.rest"><code>RequestHeaders</code></a> <li><a href="org/apache/juneau/rest/RequestQuery.html" title="class in org.apache.juneau.rest"><code>RequestQuery</code></a> <li><a href="org/apache/juneau/rest/RequestFormData.html" title="class in org.apache.juneau.rest"><code>RequestFormData</code></a> - <li><a href="org/apache/juneau/rest/RequestPathParams.html" title="class in org.apache.juneau.rest"><code>RequestPathParams</code></a> + <li><a href="org/apache/juneau/rest/RequestPathMatch.html" title="class in org.apache.juneau.rest"><code>RequestPathMatch</code></a> </ul> <li>The unannotated parameter types that can be passed in through REST Java methods has been significantly expanded. <br>For reference, the previous supported types were: @@ -6382,7 +6397,7 @@ <li><a href="org/apache/juneau/rest/RequestHeaders.html" title="class in org.apache.juneau.rest"><code>RequestHeaders</code></a> - API for accessing request headers. <li><a href="org/apache/juneau/rest/RequestQuery.html" title="class in org.apache.juneau.rest"><code>RequestQuery</code></a> - API for accessing request query parameters. <li><a href="org/apache/juneau/rest/RequestFormData.html" title="class in org.apache.juneau.rest"><code>RequestFormData</code></a> - API for accessing request form data. - <li><a href="org/apache/juneau/rest/RequestPathParams.html" title="class in org.apache.juneau.rest"><code>RequestPathParams</code></a> - API for accessing path variables. + <li><a href="org/apache/juneau/rest/RequestPathMatch.html" title="class in org.apache.juneau.rest"><code>RequestPathMatch</code></a> - API for accessing path variables. <li><a href="org/apache/juneau/rest/RequestBody.html" title="class in org.apache.juneau.rest"><code>RequestBody</code></a> - API for accessing request body. <li><a href="org/apache/juneau/http/HttpMethod.html" title="enum in org.apache.juneau.http"><code>HttpMethod</code></a> - The method name matched (when using <code><ja>@RestMethod</ja>(name=<js>"*"</js>)</code>) <li><a href="http://docs.oracle.com/javase/7/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging"><code>Logger</code></a> - The logger to use for logging. @@ -6392,7 +6407,7 @@ <li><a href="org/apache/juneau/dto/swagger/Swagger.html" title="class in org.apache.juneau.dto.swagger"><code>Swagger</code></a> - The auto-generated Swagger doc. <li><a href="org/apache/juneau/ini/ConfigFile.html" title="class in org.apache.juneau.ini"><code>ConfigFile</code></a> - The external config file for the resource. </ul> - So, for example + So, for example... <p class='bcode'> <jd>/** Old way */</jd> <ja>@RestMethod</ja>(name=<js>"*"</js>, path=<js>"/example1/{a1}/{a2}/{a3}/*"</js>) @@ -6414,12 +6429,25 @@ HttpMethod httpMethod, RequestPathParams pathParams, RequestQuery query, - AcceptLangage acceptLanguage, + AcceptLanguage acceptLanguage, Accept accept ) </p> <li>A new annotation <a href="org/apache/juneau/rest/annotation/RestResource.html#paramResolvers--"><code>@RestResource.paramResolvers()</code></a> that allows you to define your own custom Java method parameter resolvers. + <li>Fixed bug where Writer returned by <a href="org/apache/juneau/rest/RestResponse.html#getWriter--"><code>RestResponse.getWriter()</code></a> was not being flushed automatically + at the end of the HTTP call. + <li>New anntotations added to <a href="org/apache/juneau/rest/annotation/RestMethod.html" title="annotation in org.apache.juneau.rest.annotation"><code>@RestMethod</code></a>: + <ul> + <li><a href="org/apache/juneau/rest/annotation/RestMethod.html#defaultQuery--"><code>defaultQuery()</code></a> + <li><a href="org/apache/juneau/rest/annotation/RestMethod.html#defaultFormData--"><code>defaultFormData()</code></a> + </ul> + <li>Default values on header, query, and form-data annotations: + <ul> + <li><a href="org/apache/juneau/rest/annotation/Header.html#def--"><code>@Header.def()</code></a> - Default header value. + <li><a href="org/apache/juneau/rest/annotation/Query.html#def--"><code>@Query.def()</code></a> - Default query parameter value. + <li><a href="org/apache/juneau/rest/annotation/FormData.html#def--"><code>@FormData.def()</code></a> - Default form data parameter value. + </ul> </ul> <h6 class='topic'>org.apache.juneau.rest.client</h6> @@ -7854,7 +7882,7 @@ <li><code><del>RestRequest.getQueryParameterMap()</del></code> <li><code><del>RestRequest.getQueryParameterNames()</del></code> <li><a href="org/apache/juneau/rest/RestRequest.html#getPathInfoUndecoded--"><code>RestRequest.getPathInfoUndecoded()</code></a> - <li><a href="org/apache/juneau/rest/RestRequest.html#getPathRemainderUndecoded--"><code>RestRequest.getPathRemainderUndecoded()</code></a> + <li><code><del>RestRequest.getPathRemainderUndecoded()</del></code> <li><a href="org/apache/juneau/rest/RestRequest.html#getTrimmedRequestURI--"><code>RestRequest.getTrimmedRequestURI()</code></a> <li><a href="org/apache/juneau/rest/RestRequest.html#getTrimmedRequestURL--"><code>RestRequest.getTrimmedRequestURL()</code></a> <li><a href="org/apache/juneau/rest/RestRequest.html#getServletTitle--"><code>RestRequest.getServletTitle()</code></a> @@ -7863,8 +7891,8 @@ </ul> <li>Behavior changes to <a href="http://docs.oracle.com/javaee/5/api/javax/servlet/http/HttpServletRequestWrapper.html?is-external=true#getPathInfo--" title="class or interface in javax.servlet.http"><code>HttpServletRequestWrapper.getPathInfo()</code></a> to follow Servlet specs. Returns <jk>null</jk> instead of blank for no path info. - <li><a href="org/apache/juneau/rest/RestRequest.html#getPathRemainder--"><code>RestRequest.getPathRemainder()</code></a> now automatically decodes the path remainder. - Use <a href="org/apache/juneau/rest/RestRequest.html#getPathRemainderUndecoded--"><code>RestRequest.getPathRemainderUndecoded()</code></a> to get the unencoded path remainder. + <li><code><del>RestRequest.getPathRemainder()</del></code> now automatically decodes the path remainder. + Use <code><del>RestRequest.getPathRemainderUndecoded()</del></code> to get the unencoded path remainder. <li>Bug fixes in <a href="org/apache/juneau/rest/RestRequest.html#getRequestParentURI--"><code>RestRequest.getRequestParentURI()</code></a> when servlet is mapped to <js>"/*"</js>. <li>Bug fixes in <a href="org/apache/juneau/rest/RestRequest.html#getServletURI--"><code>RestRequest.getServletURI()</code></a> when servlet is mapped to <js>"/*"</js>. </ul>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/overview-tree.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/overview-tree.html b/content/site/apidocs/overview-tree.html index 4151093..5b84ab9 100644 --- a/content/site/apidocs/overview-tree.html +++ b/content/site/apidocs/overview-tree.html @@ -226,7 +226,7 @@ <li type="circle">java.util.<a href="http://docs.oracle.com/javase/7/docs/api/java/util/TreeMap.html?is-external=true" title="class or interface in java.util"><span class="typeNameLink">TreeMap</span></a><K,V> (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</a>, java.util.<a href="http://docs.oracle.com/javase/7/docs/api/java/util/NavigableMap.html?is-external=true" title="class or interface in java.util">NavigableMap</a><K,V>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>) <ul> <li type="circle">org.apache.juneau.rest.<a href="org/apache/juneau/rest/RequestHeaders.html" title="class in org.apache.juneau.rest"><span class="typeNameLink">RequestHeaders</span></a></li> -<li type="circle">org.apache.juneau.rest.<a href="org/apache/juneau/rest/RequestPathParams.html" title="class in org.apache.juneau.rest"><span class="typeNameLink">RequestPathParams</span></a></li> +<li type="circle">org.apache.juneau.rest.<a href="org/apache/juneau/rest/RequestPathMatch.html" title="class in org.apache.juneau.rest"><span class="typeNameLink">RequestPathMatch</span></a></li> </ul> </li> </ul> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/resources/juneau-doc.css ---------------------------------------------------------------------- diff --git a/content/site/apidocs/resources/juneau-doc.css b/content/site/apidocs/resources/juneau-doc.css index 572b253..1bc7c23 100644 --- a/content/site/apidocs/resources/juneau-doc.css +++ b/content/site/apidocs/resources/juneau-doc.css @@ -343,6 +343,7 @@ l { p.severe, p.warn, p.info { background-repeat: no-repeat; background-position: left center; + background-size: 16px; padding-left: 30px; min-height: 24px; } http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/serialized-form.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/serialized-form.html b/content/site/apidocs/serialized-form.html index 31ca7c2..f70d536 100644 --- a/content/site/apidocs/serialized-form.html +++ b/content/site/apidocs/serialized-form.html @@ -477,10 +477,10 @@ </li> </ul> </li> -<li class="blockList"><a name="org.apache.juneau.rest.RequestPathParams"> +<li class="blockList"><a name="org.apache.juneau.rest.RequestPathMatch"> <!-- --> </a> -<h3>Class <a href="org/apache/juneau/rest/RequestPathParams.html" title="class in org.apache.juneau.rest">org.apache.juneau.rest.RequestPathParams</a> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/util/TreeMap.html?is-external=true" title="class or interface in java.util">TreeMap</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> implements Serializable</h3> +<h3>Class <a href="org/apache/juneau/rest/RequestPathMatch.html" title="class in org.apache.juneau.rest">org.apache.juneau.rest.RequestPathMatch</a> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/util/TreeMap.html?is-external=true" title="class or interface in java.util">TreeMap</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1L</dd> @@ -493,10 +493,14 @@ <h4>parser</h4> <pre><a href="org/apache/juneau/urlencoding/UrlEncodingParser.html" title="class in org.apache.juneau.urlencoding">UrlEncodingParser</a> parser</pre> </li> -<li class="blockListLast"> +<li class="blockList"> <h4>beanSession</h4> <pre><a href="org/apache/juneau/BeanSession.html" title="class in org.apache.juneau">BeanSession</a> beanSession</pre> </li> +<li class="blockListLast"> +<h4>remainder</h4> +<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> remainder</pre> +</li> </ul> </li> </ul> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/src-html/org/apache/juneau/http/ContentMD5.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ContentMD5.html b/content/site/apidocs/src-html/org/apache/juneau/http/ContentMD5.html deleted file mode 100644 index 76fa567..0000000 --- a/content/site/apidocs/src-html/org/apache/juneau/http/ContentMD5.html +++ /dev/null @@ -1,160 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html lang="en"> -<head> -<title>Source code</title> -<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> -</head> -<body> -<div class="sourceContainer"> -<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> -<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> -<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> -<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> -<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> -<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> -<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> -<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> -<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> -<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> -<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> -<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> -<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> -<span class="sourceLineNo">014</span><a name="line.14"></a> -<span class="sourceLineNo">015</span>import java.util.concurrent.*;<a name="line.15"></a> -<span class="sourceLineNo">016</span><a name="line.16"></a> -<span class="sourceLineNo">017</span>/**<a name="line.17"></a> -<span class="sourceLineNo">018</span> * Represents a parsed <code>XXX:</code> HTTP header.<a name="line.18"></a> -<span class="sourceLineNo">019</span> * <p><a name="line.19"></a> -<span class="sourceLineNo">020</span> * <h6 class='topic>RFC2616 Specification</h6><a name="line.20"></a> -<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> -<span class="sourceLineNo">022</span>The Content-MD5 entity-header field, as defined in RFC 1864 [23], is an MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) of the entity-body. (Note: a MIC is good for detecting accidental modification of the entity-body in transit, but is not proof against malicious attacks.)<a name="line.22"></a> -<span class="sourceLineNo">023</span><a name="line.23"></a> -<span class="sourceLineNo">024</span> Content-MD5 = "Content-MD5" ":" md5-digest<a name="line.24"></a> -<span class="sourceLineNo">025</span> md5-digest = <base64 of 128 bit MD5 digest as per RFC 1864><a name="line.25"></a> -<span class="sourceLineNo">026</span>The Content-MD5 header field MAY be generated by an origin server or client to function as an integrity check of the entity-body. Only origin servers or clients MAY generate the Content-MD5 header field; proxies and gateways MUST NOT generate it, as this would defeat its value as an end-to-end integrity check. Any recipient of the entity- body, including gateways and proxies, MAY check that the digest value in this header field matches that of the entity-body as received.<a name="line.26"></a> -<span class="sourceLineNo">027</span><a name="line.27"></a> -<span class="sourceLineNo">028</span>The MD5 digest is computed based on the content of the entity-body, including any content-coding that has been applied, but not including any transfer-encoding applied to the message-body. If the message is received with a transfer-encoding, that encoding MUST be removed prior to checking the Content-MD5 value against the received entity.<a name="line.28"></a> -<span class="sourceLineNo">029</span><a name="line.29"></a> -<span class="sourceLineNo">030</span>This has the result that the digest is computed on the octets of the entity-body exactly as, and in the order that, they would be sent if no transfer-encoding were being applied.<a name="line.30"></a> -<span class="sourceLineNo">031</span><a name="line.31"></a> -<span class="sourceLineNo">032</span>HTTP extends RFC 1864 to permit the digest to be computed for MIME composite media-types (e.g., multipart/* and message/rfc822), but this does not change how the digest is computed as defined in the preceding paragraph.<a name="line.32"></a> -<span class="sourceLineNo">033</span><a name="line.33"></a> -<span class="sourceLineNo">034</span>There are several consequences of this. The entity-body for composite types MAY contain many body-parts, each with its own MIME and HTTP headers (including Content-MD5, Content-Transfer-Encoding, and Content-Encoding headers). If a body-part has a Content-Transfer- Encoding or Content-Encoding header, it is assumed that the content of the body-part has had the encoding applied, and the body-part is included in the Content-MD5 digest as is -- i.e., after the application. The Transfer-Encoding header field is not allowed within body-parts.<a name="line.34"></a> -<span class="sourceLineNo">035</span><a name="line.35"></a> -<span class="sourceLineNo">036</span>Conversion of all line breaks to CRLF MUST NOT be done before computing or checking the digest: the line break convention used in the text actually transmitted MUST be left unaltered when computing the digest.<a name="line.36"></a> -<span class="sourceLineNo">037</span><a name="line.37"></a> -<span class="sourceLineNo">038</span> Note: while the definition of Content-MD5 is exactly the same for<a name="line.38"></a> -<span class="sourceLineNo">039</span> HTTP as in RFC 1864 for MIME entity-bodies, there are several ways<a name="line.39"></a> -<span class="sourceLineNo">040</span> in which the application of Content-MD5 to HTTP entity-bodies<a name="line.40"></a> -<span class="sourceLineNo">041</span> differs from its application to MIME entity-bodies. One is that<a name="line.41"></a> -<span class="sourceLineNo">042</span> HTTP, unlike MIME, does not use Content-Transfer-Encoding, and<a name="line.42"></a> -<span class="sourceLineNo">043</span> does use Transfer-Encoding and Content-Encoding. Another is that<a name="line.43"></a> -<span class="sourceLineNo">044</span> HTTP more frequently uses binary content types than MIME, so it is<a name="line.44"></a> -<span class="sourceLineNo">045</span> worth noting that, in such cases, the byte order used to compute<a name="line.45"></a> -<span class="sourceLineNo">046</span> the digest is the transmission byte order defined for the type.<a name="line.46"></a> -<span class="sourceLineNo">047</span> Lastly, HTTP allows transmission of text types with any of several<a name="line.47"></a> -<span class="sourceLineNo">048</span> line break conventions and not just the canonical form using CRLF.<a name="line.48"></a> -<span class="sourceLineNo">049</span> * </p><a name="line.49"></a> -<span class="sourceLineNo">050</span> */<a name="line.50"></a> -<span class="sourceLineNo">051</span>public final class ContentMD5 {<a name="line.51"></a> -<span class="sourceLineNo">052</span><a name="line.52"></a> -<span class="sourceLineNo">053</span> private static final boolean nocache = Boolean.getBoolean("juneau.http.Accept.nocache");<a name="line.53"></a> -<span class="sourceLineNo">054</span> private static final ConcurrentHashMap<String,ContentMD5> cache = new ConcurrentHashMap<String,ContentMD5>();<a name="line.54"></a> -<span class="sourceLineNo">055</span><a name="line.55"></a> -<span class="sourceLineNo">056</span> /**<a name="line.56"></a> -<span class="sourceLineNo">057</span> * Returns a parsed <code>Accept</code> header.<a name="line.57"></a> -<span class="sourceLineNo">058</span> *<a name="line.58"></a> -<span class="sourceLineNo">059</span> * @param s The <code>Accept</code> header string.<a name="line.59"></a> -<span class="sourceLineNo">060</span> * @return The parsed <code>Accept</code> header, or <jk>null</jk> if the string was null.<a name="line.60"></a> -<span class="sourceLineNo">061</span> */<a name="line.61"></a> -<span class="sourceLineNo">062</span> public static ContentMD5 forString(String s) {<a name="line.62"></a> -<span class="sourceLineNo">063</span> if (s == null)<a name="line.63"></a> -<span class="sourceLineNo">064</span> return null;<a name="line.64"></a> -<span class="sourceLineNo">065</span><a name="line.65"></a> -<span class="sourceLineNo">066</span> // Prevent OOM in case of DDOS<a name="line.66"></a> -<span class="sourceLineNo">067</span> if (cache.size() > 1000)<a name="line.67"></a> -<span class="sourceLineNo">068</span> cache.clear();<a name="line.68"></a> -<span class="sourceLineNo">069</span><a name="line.69"></a> -<span class="sourceLineNo">070</span> while (true) {<a name="line.70"></a> -<span class="sourceLineNo">071</span> ContentMD5 a = cache.get(s);<a name="line.71"></a> -<span class="sourceLineNo">072</span> if (a != null)<a name="line.72"></a> -<span class="sourceLineNo">073</span> return a;<a name="line.73"></a> -<span class="sourceLineNo">074</span> a = new ContentMD5(s);<a name="line.74"></a> -<span class="sourceLineNo">075</span> if (nocache)<a name="line.75"></a> -<span class="sourceLineNo">076</span> return a;<a name="line.76"></a> -<span class="sourceLineNo">077</span> cache.putIfAbsent(s, a);<a name="line.77"></a> -<span class="sourceLineNo">078</span> }<a name="line.78"></a> -<span class="sourceLineNo">079</span> }<a name="line.79"></a> -<span class="sourceLineNo">080</span><a name="line.80"></a> -<span class="sourceLineNo">081</span> private ContentMD5(String raw) {<a name="line.81"></a> -<span class="sourceLineNo">082</span> }<a name="line.82"></a> -<span class="sourceLineNo">083</span><a name="line.83"></a> -<span class="sourceLineNo">084</span> @Override /* Object */<a name="line.84"></a> -<span class="sourceLineNo">085</span> public String toString() {<a name="line.85"></a> -<span class="sourceLineNo">086</span> return null;<a name="line.86"></a> -<span class="sourceLineNo">087</span> }<a name="line.87"></a> -<span class="sourceLineNo">088</span>}<a name="line.88"></a> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</pre> -</div> -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/src-html/org/apache/juneau/http/HeaderTimestamp.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/HeaderTimestamp.html b/content/site/apidocs/src-html/org/apache/juneau/http/HeaderTimestamp.html deleted file mode 100644 index a426458..0000000 --- a/content/site/apidocs/src-html/org/apache/juneau/http/HeaderTimestamp.html +++ /dev/null @@ -1,123 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html lang="en"> -<head> -<title>Source code</title> -<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> -</head> -<body> -<div class="sourceContainer"> -<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> -<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> -<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> -<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> -<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> -<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> -<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> -<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> -<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> -<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> -<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> -<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> -<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> -<span class="sourceLineNo">014</span><a name="line.14"></a> -<span class="sourceLineNo">015</span>import org.apache.juneau.internal.*;<a name="line.15"></a> -<span class="sourceLineNo">016</span><a name="line.16"></a> -<span class="sourceLineNo">017</span>/**<a name="line.17"></a> -<span class="sourceLineNo">018</span> * Category of headers that consist of a single HTTP-date.<a name="line.18"></a> -<span class="sourceLineNo">019</span> * <p><a name="line.19"></a> -<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> -<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> -<span class="sourceLineNo">022</span> * If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT<a name="line.22"></a> -<span class="sourceLineNo">023</span> * </p><a name="line.23"></a> -<span class="sourceLineNo">024</span> */<a name="line.24"></a> -<span class="sourceLineNo">025</span>public class HeaderTimestamp {<a name="line.25"></a> -<span class="sourceLineNo">026</span><a name="line.26"></a> -<span class="sourceLineNo">027</span> private final java.util.Date date;<a name="line.27"></a> -<span class="sourceLineNo">028</span> private final String raw;<a name="line.28"></a> -<span class="sourceLineNo">029</span><a name="line.29"></a> -<span class="sourceLineNo">030</span> /**<a name="line.30"></a> -<span class="sourceLineNo">031</span> * Constructor.<a name="line.31"></a> -<span class="sourceLineNo">032</span> * @param raw The raw header value.<a name="line.32"></a> -<span class="sourceLineNo">033</span> */<a name="line.33"></a> -<span class="sourceLineNo">034</span> protected HeaderTimestamp(String raw) {<a name="line.34"></a> -<span class="sourceLineNo">035</span> this.raw = raw;<a name="line.35"></a> -<span class="sourceLineNo">036</span> this.date = DateUtils.parseDate(raw);<a name="line.36"></a> -<span class="sourceLineNo">037</span> }<a name="line.37"></a> -<span class="sourceLineNo">038</span><a name="line.38"></a> -<span class="sourceLineNo">039</span> /**<a name="line.39"></a> -<span class="sourceLineNo">040</span> * Returns this header value as a {@link java.util.Date}.<a name="line.40"></a> -<span class="sourceLineNo">041</span> * @return This header value as a {@link java.util.Date}, or <jk>null</jk> if the header could not be parsed.<a name="line.41"></a> -<span class="sourceLineNo">042</span> */<a name="line.42"></a> -<span class="sourceLineNo">043</span> public java.util.Date asDate() {<a name="line.43"></a> -<span class="sourceLineNo">044</span> return date;<a name="line.44"></a> -<span class="sourceLineNo">045</span> }<a name="line.45"></a> -<span class="sourceLineNo">046</span><a name="line.46"></a> -<span class="sourceLineNo">047</span> @Override /* Object */<a name="line.47"></a> -<span class="sourceLineNo">048</span> public String toString() {<a name="line.48"></a> -<span class="sourceLineNo">049</span> return raw;<a name="line.49"></a> -<span class="sourceLineNo">050</span> }<a name="line.50"></a> -<span class="sourceLineNo">051</span>}<a name="line.51"></a> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</pre> -</div> -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/src-html/org/apache/juneau/http/HeaderUrl.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/HeaderUrl.html b/content/site/apidocs/src-html/org/apache/juneau/http/HeaderUrl.html deleted file mode 100644 index 0a8189a..0000000 --- a/content/site/apidocs/src-html/org/apache/juneau/http/HeaderUrl.html +++ /dev/null @@ -1,134 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html lang="en"> -<head> -<title>Source code</title> -<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> -</head> -<body> -<div class="sourceContainer"> -<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> -<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> -<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> -<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> -<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> -<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> -<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> -<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> -<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> -<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> -<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> -<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> -<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> -<span class="sourceLineNo">014</span><a name="line.14"></a> -<span class="sourceLineNo">015</span>import java.net.*;<a name="line.15"></a> -<span class="sourceLineNo">016</span><a name="line.16"></a> -<span class="sourceLineNo">017</span>import org.apache.juneau.internal.*;<a name="line.17"></a> -<span class="sourceLineNo">018</span><a name="line.18"></a> -<span class="sourceLineNo">019</span>/**<a name="line.19"></a> -<span class="sourceLineNo">020</span> * Category of headers that consist of a single URL value.<a name="line.20"></a> -<span class="sourceLineNo">021</span> * <p><a name="line.21"></a> -<span class="sourceLineNo">022</span> * <h6 class='figure'>Example</h6><a name="line.22"></a> -<span class="sourceLineNo">023</span> * <p class='bcode'><a name="line.23"></a> -<span class="sourceLineNo">024</span> * Location: http://www.w3.org/pub/WWW/People.html<a name="line.24"></a> -<span class="sourceLineNo">025</span> * </p><a name="line.25"></a> -<span class="sourceLineNo">026</span> */<a name="line.26"></a> -<span class="sourceLineNo">027</span>public class HeaderUrl{<a name="line.27"></a> -<span class="sourceLineNo">028</span><a name="line.28"></a> -<span class="sourceLineNo">029</span> final String value;<a name="line.29"></a> -<span class="sourceLineNo">030</span><a name="line.30"></a> -<span class="sourceLineNo">031</span> /**<a name="line.31"></a> -<span class="sourceLineNo">032</span> * Constructor.<a name="line.32"></a> -<span class="sourceLineNo">033</span> * @param value The raw header value.<a name="line.33"></a> -<span class="sourceLineNo">034</span> */<a name="line.34"></a> -<span class="sourceLineNo">035</span> protected HeaderUrl(String value) {<a name="line.35"></a> -<span class="sourceLineNo">036</span> this.value = StringUtils.trim(value);<a name="line.36"></a> -<span class="sourceLineNo">037</span> }<a name="line.37"></a> -<span class="sourceLineNo">038</span><a name="line.38"></a> -<span class="sourceLineNo">039</span> /**<a name="line.39"></a> -<span class="sourceLineNo">040</span> * Returns this header as a {@link URI}.<a name="line.40"></a> -<span class="sourceLineNo">041</span> * @return This header as a {@link URI}.<a name="line.41"></a> -<span class="sourceLineNo">042</span> */<a name="line.42"></a> -<span class="sourceLineNo">043</span> public URI asURI() {<a name="line.43"></a> -<span class="sourceLineNo">044</span> return URI.create(toString());<a name="line.44"></a> -<span class="sourceLineNo">045</span> }<a name="line.45"></a> -<span class="sourceLineNo">046</span><a name="line.46"></a> -<span class="sourceLineNo">047</span> /**<a name="line.47"></a> -<span class="sourceLineNo">048</span> * Returns this header as a simple string value.<a name="line.48"></a> -<span class="sourceLineNo">049</span> * <p><a name="line.49"></a> -<span class="sourceLineNo">050</span> * Functionally equivalent to calling {@link #toString()}.<a name="line.50"></a> -<span class="sourceLineNo">051</span> *<a name="line.51"></a> -<span class="sourceLineNo">052</span> * @return This header as a simple string.<a name="line.52"></a> -<span class="sourceLineNo">053</span> */<a name="line.53"></a> -<span class="sourceLineNo">054</span> public String asString() {<a name="line.54"></a> -<span class="sourceLineNo">055</span> return value;<a name="line.55"></a> -<span class="sourceLineNo">056</span> }<a name="line.56"></a> -<span class="sourceLineNo">057</span><a name="line.57"></a> -<span class="sourceLineNo">058</span> @Override /* Object */<a name="line.58"></a> -<span class="sourceLineNo">059</span> public String toString() {<a name="line.59"></a> -<span class="sourceLineNo">060</span> return value == null ? "" : value;<a name="line.60"></a> -<span class="sourceLineNo">061</span> }<a name="line.61"></a> -<span class="sourceLineNo">062</span>}<a name="line.62"></a> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</pre> -</div> -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/src-html/org/apache/juneau/http/HeaderValidator.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/HeaderValidator.html b/content/site/apidocs/src-html/org/apache/juneau/http/HeaderValidator.html deleted file mode 100644 index 555a5f0..0000000 --- a/content/site/apidocs/src-html/org/apache/juneau/http/HeaderValidator.html +++ /dev/null @@ -1,119 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html lang="en"> -<head> -<title>Source code</title> -<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> -</head> -<body> -<div class="sourceContainer"> -<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> -<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> -<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> -<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> -<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> -<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> -<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> -<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> -<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> -<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> -<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> -<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> -<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> -<span class="sourceLineNo">014</span><a name="line.14"></a> -<span class="sourceLineNo">015</span>/**<a name="line.15"></a> -<span class="sourceLineNo">016</span> * Category of headers that consist of a single validator value.<a name="line.16"></a> -<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> -<span class="sourceLineNo">018</span> * <h6 class='figure'>Example</h6><a name="line.18"></a> -<span class="sourceLineNo">019</span> * <p class='bcode'><a name="line.19"></a> -<span class="sourceLineNo">020</span> * ETag: "xyzzy"<a name="line.20"></a> -<span class="sourceLineNo">021</span> * </p><a name="line.21"></a> -<span class="sourceLineNo">022</span> */<a name="line.22"></a> -<span class="sourceLineNo">023</span>public class HeaderValidator {<a name="line.23"></a> -<span class="sourceLineNo">024</span><a name="line.24"></a> -<span class="sourceLineNo">025</span> private final EntityValidator value;<a name="line.25"></a> -<span class="sourceLineNo">026</span><a name="line.26"></a> -<span class="sourceLineNo">027</span> /**<a name="line.27"></a> -<span class="sourceLineNo">028</span> * Constructor.<a name="line.28"></a> -<span class="sourceLineNo">029</span> * @param value The raw header value.<a name="line.29"></a> -<span class="sourceLineNo">030</span> */<a name="line.30"></a> -<span class="sourceLineNo">031</span> protected HeaderValidator(String value) {<a name="line.31"></a> -<span class="sourceLineNo">032</span> this.value = new EntityValidator(value);<a name="line.32"></a> -<span class="sourceLineNo">033</span> }<a name="line.33"></a> -<span class="sourceLineNo">034</span><a name="line.34"></a> -<span class="sourceLineNo">035</span> /**<a name="line.35"></a> -<span class="sourceLineNo">036</span> * Returns this header value as a {@link EntityValidator} object.<a name="line.36"></a> -<span class="sourceLineNo">037</span> * @return this header value as a {@link EntityValidator} object.<a name="line.37"></a> -<span class="sourceLineNo">038</span> */<a name="line.38"></a> -<span class="sourceLineNo">039</span> public EntityValidator asValidator() {<a name="line.39"></a> -<span class="sourceLineNo">040</span> return value;<a name="line.40"></a> -<span class="sourceLineNo">041</span> }<a name="line.41"></a> -<span class="sourceLineNo">042</span><a name="line.42"></a> -<span class="sourceLineNo">043</span> @Override /* Object */<a name="line.43"></a> -<span class="sourceLineNo">044</span> public String toString() {<a name="line.44"></a> -<span class="sourceLineNo">045</span> return value.toString();<a name="line.45"></a> -<span class="sourceLineNo">046</span> }<a name="line.46"></a> -<span class="sourceLineNo">047</span>}<a name="line.47"></a> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</pre> -</div> -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/0c968486/content/site/apidocs/src-html/org/apache/juneau/http/HeaderValidatorArray.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/HeaderValidatorArray.html b/content/site/apidocs/src-html/org/apache/juneau/http/HeaderValidatorArray.html deleted file mode 100644 index 648866f..0000000 --- a/content/site/apidocs/src-html/org/apache/juneau/http/HeaderValidatorArray.html +++ /dev/null @@ -1,127 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html lang="en"> -<head> -<title>Source code</title> -<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> -</head> -<body> -<div class="sourceContainer"> -<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> -<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> -<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> -<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> -<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> -<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> -<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> -<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> -<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> -<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> -<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> -<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> -<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> -<span class="sourceLineNo">014</span><a name="line.14"></a> -<span class="sourceLineNo">015</span>import org.apache.juneau.internal.*;<a name="line.15"></a> -<span class="sourceLineNo">016</span><a name="line.16"></a> -<span class="sourceLineNo">017</span>/**<a name="line.17"></a> -<span class="sourceLineNo">018</span> * Category of headers that consist of a comma-delimited list of validator values.<a name="line.18"></a> -<span class="sourceLineNo">019</span> * <p><a name="line.19"></a> -<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> -<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> -<span class="sourceLineNo">022</span> * If-Match: "xyzzy"<a name="line.22"></a> -<span class="sourceLineNo">023</span> * If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"<a name="line.23"></a> -<span class="sourceLineNo">024</span> * If-Match: *<a name="line.24"></a> -<span class="sourceLineNo">025</span> * </p><a name="line.25"></a> -<span class="sourceLineNo">026</span> */<a name="line.26"></a> -<span class="sourceLineNo">027</span>public class HeaderValidatorArray {<a name="line.27"></a> -<span class="sourceLineNo">028</span><a name="line.28"></a> -<span class="sourceLineNo">029</span> private final EntityValidator[] value;<a name="line.29"></a> -<span class="sourceLineNo">030</span><a name="line.30"></a> -<span class="sourceLineNo">031</span> /**<a name="line.31"></a> -<span class="sourceLineNo">032</span> * Constructor.<a name="line.32"></a> -<span class="sourceLineNo">033</span> * @param value The raw header value.<a name="line.33"></a> -<span class="sourceLineNo">034</span> */<a name="line.34"></a> -<span class="sourceLineNo">035</span> protected HeaderValidatorArray(String value) {<a name="line.35"></a> -<span class="sourceLineNo">036</span> String[] s = StringUtils.split(value, ',');<a name="line.36"></a> -<span class="sourceLineNo">037</span> this.value = new EntityValidator[s.length];<a name="line.37"></a> -<span class="sourceLineNo">038</span> for (int i = 0; i < s.length; i++) {<a name="line.38"></a> -<span class="sourceLineNo">039</span> this.value[i] = new EntityValidator(s[i]);<a name="line.39"></a> -<span class="sourceLineNo">040</span> }<a name="line.40"></a> -<span class="sourceLineNo">041</span> }<a name="line.41"></a> -<span class="sourceLineNo">042</span><a name="line.42"></a> -<span class="sourceLineNo">043</span> /**<a name="line.43"></a> -<span class="sourceLineNo">044</span> * Returns this header value as an array of {@link EntityValidator} objects.<a name="line.44"></a> -<span class="sourceLineNo">045</span> * @return this header value as an array of {@link EntityValidator} objects.<a name="line.45"></a> -<span class="sourceLineNo">046</span> */<a name="line.46"></a> -<span class="sourceLineNo">047</span> public EntityValidator[] asValidators() {<a name="line.47"></a> -<span class="sourceLineNo">048</span> return value;<a name="line.48"></a> -<span class="sourceLineNo">049</span> }<a name="line.49"></a> -<span class="sourceLineNo">050</span><a name="line.50"></a> -<span class="sourceLineNo">051</span> @Override /* Object */<a name="line.51"></a> -<span class="sourceLineNo">052</span> public String toString() {<a name="line.52"></a> -<span class="sourceLineNo">053</span> return StringUtils.join(value, ", ");<a name="line.53"></a> -<span class="sourceLineNo">054</span> }<a name="line.54"></a> -<span class="sourceLineNo">055</span>}<a name="line.55"></a> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</pre> -</div> -</body> -</html>
