Author: juanpablo Date: Mon Dec 2 22:23:17 2013 New Revision: 1547221 URL: http://svn.apache.org/r1547221 Log: * removed WikiContext.getBundle( String ), consider using Preferences.getBundle( String ) * removed WikiContext.getLocale( WikiContext ), consider using Preferences.getLocale( WikiContext ) * removed WikiContext.hasAccess( HttpServletResponse ), consider using AuthorizationManager.hasAccess( HttpServletResponse ) * removed WikiContext.hasAccess( HttpServletResponse, boolean ), consider using AuthorizationManager.hasAccess( HttpServletResponse, boolean )
Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiContext.java Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiContext.java URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiContext.java?rev=1547221&r1=1547220&r2=1547221&view=diff ============================================================================== --- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiContext.java (original) +++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiContext.java Mon Dec 2 22:23:17 2013 @@ -778,53 +778,6 @@ public class WikiContext } /** - * Checks whether the current user has access to this wiki context, - * by obtaining the required Permission ({@link #requiredPermission()}) - * and delegating the access check to - * {@link org.apache.wiki.auth.AuthorizationManager#checkPermission(WikiSession, Permission)}. - * If the user is allowed, this method returns <code>true</code>; - * <code>false</code> otherwise. If access is allowed, - * the wiki context will be added to the request as an attribute - * with the key name {@link org.apache.wiki.tags.WikiTagBase#ATTR_CONTEXT}. - * Note that this method will automatically redirect the user to - * a login or error page, as appropriate, if access fails. This is - * NOT guaranteed to be default behavior in the future. - * @param response the http response - * @return the result of the access check - * @throws IOException In case something goes wrong - * @deprecated will be removed in 2.10 scope. Consider using - * {@link org.apache.wiki.auth.AuthorizationManager#hasAccess(WikiContext, HttpServletResponse)} - * instead - */ - @Deprecated - public boolean hasAccess( HttpServletResponse response ) throws IOException - { - return m_engine.getAuthorizationManager().hasAccess( this, response, true ); - } - - /** - * Checks whether the current user has access to this wiki context (and - * optionally redirects if not), by obtaining the required Permission ({@link #requiredPermission()}) - * and delegating the access check to - * {@link org.apache.wiki.auth.AuthorizationManager#checkPermission(WikiSession, Permission)}. - * If the user is allowed, this method returns <code>true</code>; - * <code>false</code> otherwise. If access is allowed, - * the wiki context will be added to the request as attribute - * with the key name {@link org.apache.wiki.tags.WikiTagBase#ATTR_CONTEXT}. - * @return the result of the access check - * @param response The servlet response object - * @param redirect If true, makes an automatic redirect to the response - * @throws IOException If something goes wrong - * @deprecated will be removed in 2.10 scope. Consider using - * {@link org.apache.wiki.auth.AuthorizationManager#hasAccess(WikiContext, HttpServletResponse, boolean)} instead - */ - @Deprecated - public boolean hasAccess( HttpServletResponse response, boolean redirect ) throws IOException - { - return m_engine.getAuthorizationManager().hasAccess( this, response, redirect ); - } - - /** * Returns true, if the current user has administrative permissions (i.e. the omnipotent * AllPermission). * @@ -928,41 +881,4 @@ public class WikiContext } } - /** - * Locates the i18n ResourceBundle given. This method interprets - * the request locale, and uses that to figure out which language the - * user wants. - * @see org.apache.wiki.i18n.InternationalizationManager - * @param bundle The name of the bundle you are looking for. - * @return A resource bundle object - * @throws MissingResourceException If the bundle cannot be found - * @deprecated will be removed in 2.10 scope. Consider using - * {@link Preferences#getBundle(WikiContext,String)} instead. - */ - @Deprecated - // FIXME: This method should really cache the ResourceBundles or something... - public ResourceBundle getBundle( String bundle ) throws MissingResourceException - { - Locale loc = Preferences.getLocale( this ); - - ResourceBundle b = m_engine.getInternationalizationManager().getBundle(bundle, loc); - - return b; - } - - /** - * Returns the locale of the HTTP request if available, - * otherwise returns the default Locale of the server. - * - * @return A valid locale object - * @param context The WikiContext - * @deprecated will be removed in 2.10 scope. Consider using {@link Preferences#getLocale(WikiContext)} - * instead - */ - @Deprecated - public static Locale getLocale( WikiContext context ) - { - return Preferences.getLocale( context ); - } - }