incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r644959 - in /incubator/sling/trunk/api/src/main/java/org/apache/sling/api: SlingHttpServletRequest.java wrappers/SlingHttpServletRequestWrapper.java
Date Fri, 04 Apr 2008 22:22:55 GMT
Author: fmeschbe
Date: Fri Apr  4 15:22:50 2008
New Revision: 644959

URL: http://svn.apache.org/viewvc?rev=644959&view=rev
Log:
SLING-363 Add new getResourceBundle(String baseName, Locale locale) method

Modified:
    incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java
    incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java

Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java?rev=644959&r1=644958&r2=644959&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java
(original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java
Fri Apr  4 15:22:50 2008
@@ -57,7 +57,7 @@
 
     /**
      * Returns the {@link Resource} object on whose behalf the servlet acts.
-     *
+     * 
      * @return The <code>Resource</code> object of this request.
      */
     Resource getResource();
@@ -65,14 +65,14 @@
     /**
      * Returns the {@link ResourceResolver} which resolved the
      * {@link #getResource() resource} of this request.
-     *
+     * 
      * @return The resource resolver
      */
     ResourceResolver getResourceResolver();
 
     /**
      * Returns the {@link RequestPathInfo} pertaining to this request.
-     *
+     * 
      * @return the request path info.
      */
     RequestPathInfo getRequestPathInfo();
@@ -91,7 +91,7 @@
      * <p>
      * This method is a shortcut for
      * <code>getRequestParameterMap().getValue(String)</code>.
-     *
+     * 
      * @param name a <code>String</code> specifying the name of the parameter
      * @return a {@link RequestParameter} representing the single value of the
      *         parameter
@@ -110,7 +110,7 @@
      * <p>
      * This method is a shortcut for
      * <code>getRequestParameterMap().getValues(String)</code>.
-     *
+     * 
      * @param name a <code>String</code> containing the name of the parameter
      *            the value of which is requested
      * @return an array of {@link RequestParameter} objects containing the
@@ -128,7 +128,7 @@
      * {@link RequestParameter} array (<code>RequestParameter[]</code>).
      * <p>
      * If no parameters exist this method returns an empty <code>Map</code>.
-     *
+     * 
      * @return an immutable <code>Map</code> containing parameter names as
      *         keys and parameter values as map values, or an empty
      *         <code>Map</code> if no parameters exist. The keys in the
@@ -145,7 +145,7 @@
      * <p>
      * Returns <code>null</code> if a <code>RequestDispatcher</code>
cannot
      * be returned for any reason.
-     *
+     * 
      * @param path a <code>String</code> specifying the pathname to the
      *            resource. If it is relative, it must be relative against the
      *            current servlet.
@@ -165,7 +165,7 @@
      * <p>
      * Returns <code>null</code> if a <code>RequestDispatcher</code>
cannot
      * be returned for any reason.
-     *
+     * 
      * @param resource The {@link Resource} instance whose response content may
      *            be included by the returned dispatcher.
      * @param options influence the rendering of the included Resource
@@ -185,7 +185,7 @@
     /**
      * Returns the named cookie from the HTTP request or <code>null</code> if
      * no such cookie exists in the request.
-     *
+     * 
      * @param name The name of the cookie to return.
      * @return The named cookie or <code>null</code> if no such cookie exists.
      */
@@ -198,7 +198,7 @@
      * For included resources this method will returned the same string as
      * returned by the <code>ServletResponse.getContentType()</code> without
      * the character set.
-     *
+     * 
      * @return preferred MIME type of the response
      */
     String getResponseContentType();
@@ -213,20 +213,34 @@
      * containing a single entry which is the same string as returned by the
      * <code>ServletResponse.getContentType()</code> without the character
      * set.
-     *
+     * 
      * @return ordered list of MIME types for the response
      */
     Enumeration<String> getResponseContentTypes();
 
     /**
      * Returns the resource bundle for the given locale.
-     *
+     * 
      * @param locale the locale for which to retrieve the resource bundle. If
      *            this is <code>null</code>, the locale returned by
      *            {@link #getLocale()} is used to select the resource bundle.
      * @return the resource bundle for the given locale
      */
     ResourceBundle getResourceBundle(Locale locale);
+
+    /**
+     * Returns the resource bundle of the given base name for the given locale.
+     * 
+     * @param baseName The base name of the resource bundle to returned. If this
+     *            parameter is <code>null</code>, the same resource bundle
+     *            must be returned as if the {@link #getResourceBundle(Locale)}
+     *            method is called.
+     * @param locale the locale for which to retrieve the resource bundle. If
+     *            this is <code>null</code>, the locale returned by
+     *            {@link #getLocale()} is used to select the resource bundle.
+     * @return the resource bundle for the given locale
+     */
+    ResourceBundle getResourceBundle(String baseName, Locale locale);
 
     /**
      * Returns the {@link RequestProgressTracker} of this request.

Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java?rev=644959&r1=644958&r2=644959&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java
(original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java
Fri Apr  4 15:22:50 2008
@@ -106,6 +106,10 @@
         return getSlingRequest().getResourceBundle(locale);
     }
 
+    public ResourceBundle getResourceBundle(String baseName, Locale locale) {
+        return getSlingRequest().getResourceBundle(baseName, locale);
+    }
+    
     public String getResponseContentType() {
         return getSlingRequest().getResponseContentType();
     }



Mime
View raw message