diff servlet/src/digilib/auth/AuthOpsImpl.java @ 181:afe7ff98bb71

Servlet version 1.18b1 - new transfer mode "rawfile" with mime-type application/octet-stream - finally proper logging with Log4J! - therefore a lot of debugging-prints changed - the Util class is now useless - ServletOps and FileOps are now purely static
author robcast
date Fri, 21 Nov 2003 00:17:31 +0100
parents 3b8797fc3e90
children 26b2a74e2fe5
line wrap: on
line diff
--- a/servlet/src/digilib/auth/AuthOpsImpl.java	Fri Nov 21 00:11:18 2003 +0100
+++ b/servlet/src/digilib/auth/AuthOpsImpl.java	Fri Nov 21 00:17:31 2003 +0100
@@ -20,10 +20,14 @@
 
 package digilib.auth;
 
+import java.util.List;
+import java.util.ListIterator;
+
 import javax.servlet.http.HttpServletRequest;
-import java.util.*;
 
-import digilib.*;
+import org.apache.log4j.Logger;
+
+import digilib.Utils;
 import digilib.servlet.DigilibRequest;
 
 /** Basic implementation of AuthOps interface.
@@ -33,12 +37,11 @@
  */
 public abstract class AuthOpsImpl implements AuthOps {
 
-  /** Local utils object. */    
-  protected Utils util;
-
+	/** general logger for this class */
+	protected Logger logger = Logger.getLogger(this.getClass());
+	
   /** Default constructor. */  
   public AuthOpsImpl() {
-    util = new Utils();
     try {
       init();
     } catch (AuthOpException e) {
@@ -49,7 +52,6 @@
    * @param u utils object.
    */  
   public AuthOpsImpl(Utils u) {
-    util = u;
     try {
       init();
     } catch (AuthOpException e) {
@@ -111,9 +113,9 @@
     String s = "";
     while (r.hasNext()) {
       s = (String)r.next();
-      util.dprintln(5, "Testing role: "+s);
+      logger.debug("Testing role: "+s);
       if (request.isUserInRole(s)) {
-        util.dprintln(5, "Role Authorized");
+      	logger.debug("Role Authorized");
         return true;
       }
     }
@@ -128,9 +130,9 @@
 	String s = "";
 	while (r.hasNext()) {
 	  s = (String)r.next();
-	  util.dprintln(5, "Testing role: "+s);
+	  logger.debug("Testing role: "+s);
 	  if (((HttpServletRequest)request.getServletRequest()).isUserInRole(s)) {
-		util.dprintln(5, "Role Authorized");
+	  	logger.debug("Role Authorized");
 		return true;
 	  }
 	}