Author: jalkanen
Date: Sat May 24 04:17:17 2008
New Revision: 659792
URL: http://svn.apache.org/viewvc?rev=659792&view=rev
Log:
Fixed a couple of checkstyle warnings.
Added:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/package.html
Modified:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/AuthenticationManager.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/SecurityVerifier.java
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java
Modified:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java?rev=659792&r1=659791&r2=659792&view=diff
==============================================================================
---
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
(original)
+++
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentManager.java
Sat May 24 04:17:17 2008
@@ -307,6 +307,7 @@
*/
// FIXME: This API should be changed to return a List.
+ @SuppressWarnings("unchecked")
public Collection listAttachments( WikiPage wikipage )
throws ProviderException
{
Modified:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java?rev=659792&r1=659791&r2=659792&view=diff
==============================================================================
---
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
(original)
+++
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/attachment/AttachmentServlet.java
Sat May 24 04:17:17 2008
@@ -562,6 +562,7 @@
* @throws IOException If upload fails
* @throws FileUploadException
*/
+ @SuppressWarnings("unchecked")
protected String upload( HttpServletRequest req )
throws RedirectException,
IOException
@@ -632,6 +633,9 @@
}
}
+ if( actualFile == null )
+ throw new RedirectException( "Broken file upload", errorPage );
+
//
// FIXME: Unfortunately, with Apache fileupload we will get the
form fields in
// order. This means that we have to gather all the
metadata from the
Modified:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/AuthenticationManager.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/AuthenticationManager.java?rev=659792&r1=659791&r2=659792&view=diff
==============================================================================
---
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/AuthenticationManager.java
(original)
+++
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/AuthenticationManager.java
Sat May 24 04:17:17 2008
@@ -30,7 +30,6 @@
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
-import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -113,7 +112,7 @@
protected static final Map<String,String> EMPTY_MAP =
Collections.unmodifiableMap( new HashMap<String,String>() );
/** Class (of type LoginModule) to use for custom authentication. */
- protected Class<? extends LoginModule> m_loginModuleClass =
UserDatabaseLoginModule.class;;
+ protected Class<? extends LoginModule> m_loginModuleClass =
UserDatabaseLoginModule.class;
/** Options passed to [EMAIL PROTECTED]
javax.security.auth.spi.LoginModule#initialize(Subject, CallbackHandler, Map,
Map)};
* initialized by [EMAIL PROTECTED] #initialize(WikiEngine, Properties)}.
*/
@@ -277,12 +276,8 @@
{
e.printStackTrace();
throw new WikiSecurityException( e.getMessage() );
- }
- if ( handler == null )
- {
- throw new WikiSecurityException("Callback handler returned
null for some reason... this is very unusual.");
}
-
+
// Execute the container login module, then (if that fails) the
cookie auth module
Set<Principal> principals = authenticationMgr.doJAASLogin(
WebContainerLoginModule.class, handler, options );
if ( principals.size() == 0 &&
authenticationMgr.allowsCookieAuthentication() )
@@ -344,7 +339,6 @@
* @param password the password
* @return true, if the username/password is valid
* @throws com.ecyrd.jspwiki.auth.WikiSecurityException if the Authorizer
or UserManager cannot be obtained
- * @throws ServletException if the specified LoginModule cannot be
executed for any reason other than authentication failures
*/
public final boolean login( WikiSession session, String username, String
password ) throws WikiSecurityException
{
@@ -509,9 +503,8 @@
* @param options
* a Map of key/value strings for initializing the LoginModule
* @return the set of Principals returned by the JAAS method [EMAIL
PROTECTED] Subject#getPrincipals()}
- * @throws ServletException
+ * @throws WikiSecurityException
* if the LoginModule could not be instantiated for any reason
- * (the root cause exception is wrapped)
*/
protected Set<Principal> doJAASLogin(Class<? extends LoginModule> clazz,
CallbackHandler handler, Map<String,String> options) throws
WikiSecurityException
{
Modified:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/SecurityVerifier.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/SecurityVerifier.java?rev=659792&r1=659791&r2=659792&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/SecurityVerifier.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/SecurityVerifier.java
Sat May 24 04:17:17 2008
@@ -45,7 +45,6 @@
import com.ecyrd.jspwiki.auth.permissions.GroupPermission;
import com.ecyrd.jspwiki.auth.permissions.PermissionFactory;
import com.ecyrd.jspwiki.auth.permissions.WikiPermission;
-import com.ecyrd.jspwiki.auth.user.DefaultUserProfile;
import com.ecyrd.jspwiki.auth.user.UserDatabase;
import com.ecyrd.jspwiki.auth.user.UserProfile;
@@ -675,6 +674,7 @@
* resolves to an existing file, and the policy file contained therein
* represents a valid policy.
*/
+ @SuppressWarnings("unchecked")
protected final void verifyPolicy()
{
// Look up the policy file and set the status text.
@@ -708,7 +708,7 @@
// Verify the file
policy.read();
- List<Exception> errors = (List<Exception>)policy.getMessages();
+ List<Exception> errors = policy.getMessages();
if ( errors.size() > 0 )
{
for( Exception e : errors )
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java?rev=659792&r1=659791&r2=659792&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java Sat May
24 04:17:17 2008
@@ -563,6 +563,12 @@
{ /* It's clean */ }
}
+ /**
+ * A helper method for returning all of the known WikiNames in this
system.
+ *
+ * @return An Array of Principals
+ * @throws WikiSecurityException If for reason the names cannot be fetched
+ */
public Principal[] listWikiNames()
throws WikiSecurityException
{
Added: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/package.html
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/package.html?rev=659792&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/package.html (added)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/acl/package.html Sat May
24 04:17:17 2008
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JSPWiki: ACL</title>
+</head>
+<body>
+
+<p>Access Control List implementation.</p>
+
+<h3>Package Specification</h3>
+
+<p>This package contains all the JSPWiki ACL implementation.</p>
+
+<h3>Related Documentation</h3>
+
+</body>
+</html>
\ No newline at end of file