You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by so...@apache.org on 2007/09/11 23:39:44 UTC

svn commit: r574702 [1/6] - in /lenya/branches/revolution/1.3.x: ./ lib/ src/java/org/apache/lenya/ac/ src/java/org/apache/lenya/ac/file/ src/java/org/apache/lenya/ac/impl/ src/java/org/apache/lenya/cms/ac/ src/java/org/apache/lenya/cms/ac/cocoon/ src/...

Author: solprovider
Date: Tue Sep 11 14:39:37 2007
New Revision: 574702

URL: http://svn.apache.org/viewvc?rev=574702&view=rev
Log:
Tested as stand-alone Eclipse 3.2 project.  Added latest versions of missing libraries.  Fixed all errors.

Added:
    lenya/branches/revolution/1.3.x/lib/avalon-framework-api-4.3.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/avalon-framework-impl-4.3.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/cocoon-2.1.10.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/commons-httpclient-3.0.1.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/commons-lang-2.3.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/excalibur-pool-api-2.1.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/excalibur-pool-impl-2.1.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/excalibur-sourceresolve-2.2.3.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/excalibur-xmlutil-2.1.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/jakarta-regexp-1.5.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/jtidy-04aug2000r7-dev.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/log4j-1.2.15.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/lucene-core-2.2.0.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/quartz-1.6.0.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/xalanj-2.7.0.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/xercesImpl-2.7.0.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/xml-apis-2.7.0.jar   (with props)
    lenya/branches/revolution/1.3.x/lib/xml-commons-resolver-1.2.jar   (with props)
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/SitetreeGenerator.java
      - copied unchanged from r573933, lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/SitetreeGenerator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/index/
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/index/FlatIndexPart.java
      - copied unchanged from r573933, lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatIndexPart.java
Removed:
    lenya/branches/revolution/1.3.x/lib/xercesImpl-2.6.2.jar
    lenya/branches/revolution/1.3.x/lib/xml-apis.jar
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/SitetreeGenerator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatIndexPart.java
Modified:
    lenya/branches/revolution/1.3.x/13ABOUT.txt
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Identity.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Machine.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroup.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroupManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRangeManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileItemManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUser.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUserManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/AbstractGroup.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/AbstractGroupable.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/AbstractItem.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/AbstractRole.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/BypassableAccessController.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/ComposableAccessControllerResolver.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/Credential.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/DefaultAccessController.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/DefaultPolicy.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/PolicyAuthorizer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/PolicyBuilder.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/URLPolicy.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/PublicationAccessControllerResolver.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/cocoon/PolicyHelper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/usecase/UsecaseRolesBuilder.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ant/PublicationTask.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ant/SetIdentifier.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/UploadAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/WorkflowInvokerAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/source/impl/ContentSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/source/impl/ModuleSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/AbstractPublication.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DefaultDocumentIdToPathMapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DefaultSiteTree.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DocumentSet.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DocumentType.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/IdentityDocumentIdToPathMapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/PageEnvelope.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/PublicationFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/ResourcesManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/URLInformation.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/task/PublicationTask.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/WorkflowInvoker.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/workflow/CMSHistory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/workflow/WorkflowDocument.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/workflow/WorkflowFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/FileDocument.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/HTMLDocument.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/ReTokenizeFile.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/SearchFiles.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/html/HtmlDocument.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/index/AbstractDocumentCreator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/index/AbstractIndexer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/index/DefaultDocumentCreator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/CacheMap.java

Modified: lenya/branches/revolution/1.3.x/13ABOUT.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13ABOUT.txt?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13ABOUT.txt (original)
+++ lenya/branches/revolution/1.3.x/13ABOUT.txt Tue Sep 11 14:39:37 2007
@@ -1,12 +1,16 @@
 About Lenya 1.3
 
 === History
-In February 2006, I started a private fork of Lenya 1.2.2.  In June 2006, the other Committers expressed interest in (or demanded) the code.  I stopped new development, and integrated my code with Lenya1.2.x.  That merger is what you see.
+February 2006: Started a private fork of Lenya 1.2.2.  
+June 2006: The other Committers expressed interest in (or demanded) the code.  I stopped new development and integrated my code with Lenya 1.2.x (between the 1.2.4 and 1.2.5 releases.)
+September 2006 - August 2007: I had no time for this project.
+September 2007: Returned to project.  Created as Eclipse 3.2 project.  Added latest version of missing libraries and updated code.
+The next step is to merge changes from last year's work and complete the edit functionality.
 
 Lenya1.3 is not finished.  Specifically, it does not have the ability to edit documents directly in the flat datastore.  See the 13TODO.txt for everything still under development.
 
 Enjoy,
-solprovider
+Paul Ercolino (solprovider)
 
 
 === Features

Added: lenya/branches/revolution/1.3.x/lib/avalon-framework-api-4.3.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/avalon-framework-api-4.3.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/avalon-framework-api-4.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/avalon-framework-impl-4.3.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/avalon-framework-impl-4.3.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/avalon-framework-impl-4.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/cocoon-2.1.10.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/cocoon-2.1.10.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/cocoon-2.1.10.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/commons-httpclient-3.0.1.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/commons-httpclient-3.0.1.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/commons-httpclient-3.0.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/commons-lang-2.3.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/commons-lang-2.3.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/commons-lang-2.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/excalibur-pool-api-2.1.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/excalibur-pool-api-2.1.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/excalibur-pool-api-2.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/excalibur-pool-impl-2.1.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/excalibur-pool-impl-2.1.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/excalibur-pool-impl-2.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/excalibur-sourceresolve-2.2.3.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/excalibur-sourceresolve-2.2.3.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/excalibur-sourceresolve-2.2.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/excalibur-xmlutil-2.1.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/excalibur-xmlutil-2.1.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/excalibur-xmlutil-2.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/jakarta-regexp-1.5.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/jakarta-regexp-1.5.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/jakarta-regexp-1.5.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/jtidy-04aug2000r7-dev.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/jtidy-04aug2000r7-dev.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/jtidy-04aug2000r7-dev.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/log4j-1.2.15.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/log4j-1.2.15.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/log4j-1.2.15.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/lucene-core-2.2.0.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/lucene-core-2.2.0.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/lucene-core-2.2.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/quartz-1.6.0.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/quartz-1.6.0.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/quartz-1.6.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/xalanj-2.7.0.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/xalanj-2.7.0.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/xalanj-2.7.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/xercesImpl-2.7.0.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/xercesImpl-2.7.0.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/xercesImpl-2.7.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/xml-apis-2.7.0.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/xml-apis-2.7.0.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/xml-apis-2.7.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/lib/xml-commons-resolver-1.2.jar
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/lib/xml-commons-resolver-1.2.jar?rev=574702&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/lib/xml-commons-resolver-1.2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Identity.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Identity.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Identity.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Identity.java Tue Sep 11 14:39:37 2007
@@ -14,122 +14,109 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.ac;
 
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
-
 import org.apache.cocoon.environment.Session;
 import org.apache.log4j.Category;
 
 /**
- * Identity object. Used to store the authenticated accreditables in the session.
+ * Identity object. Used to store the authenticated accreditables in the
+ * session.
  */
 public class Identity implements Identifiable, java.io.Serializable {
     private Set identifiables = new HashSet();
-    
     private static final Category log = Category.getInstance(Identity.class);
-    
     /**
      * Ctor.
      */
     public Identity() {
         addIdentifiable(World.getInstance());
     }
-
     /**
-     * In the case of Tomcat the object will be serialized to TOMCAT/work/Standalone/localhost/lenya/SESSIONS.ser
+     * In the case of Tomcat the object will be serialized to
+     * TOMCAT/work/Standalone/localhost/lenya/SESSIONS.ser
      */
     private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
         if (log.isDebugEnabled()) {
-        	log.debug("Serializing identity which is attached to session: " + this.toString());
+            log.debug("Serializing identity which is attached to session: " + this.toString());
         }
         out.defaultWriteObject();
         out.writeObject(identifiables);
     }
-
     /**
-     * In case of Tomcat the object will be restored from TOMCAT/work/Standalone/localhost/lenya/SESSIONS.ser
+     * In case of Tomcat the object will be restored from
+     * TOMCAT/work/Standalone/localhost/lenya/SESSIONS.ser
      */
     private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
         in.defaultReadObject();
         identifiables = (Set) in.readObject();
-
         if (log.isDebugEnabled()) {
-        	log.debug("Identity loaded from serialized object: " + this.toString());
+            log.debug("Identity loaded from serialized object: " + this.toString());
         }
     }
-
     /**
      * Returns the identifiables of this identity.
+     * 
      * @return An array of identifiables.
      */
     public Identifiable[] getIdentifiables() {
         return (Identifiable[]) identifiables.toArray(new Identifiable[identifiables.size()]);
     }
-
     /**
      * Adds a new identifiable to this identity.
-     * @param identifiable The identifiable to add.
+     * 
+     * @param identifiable
+     *            The identifiable to add.
      */
     public void addIdentifiable(Identifiable identifiable) {
-        assert identifiable != null;
-        assert identifiable != this;
-        assert !identifiables.contains(identifiable);
-        
+        // assert identifiable != null;
+        // assert identifiable != this;
+        // assert !identifiables.contains(identifiable);
         if (log.isDebugEnabled()) {
             log.debug("Adding identifiable: [" + identifiable + "]");
         }
-        
         identifiables.add(identifiable);
     }
-
     /**
      * @see Accreditable#getAccreditables()
      */
     public Accreditable[] getAccreditables() {
         Set accreditables = new HashSet();
         Identifiable[] identifiables = getIdentifiables();
-
         for (int i = 0; i < identifiables.length; i++) {
             Accreditable[] groupAccreditables = identifiables[i].getAccreditables();
             accreditables.addAll(Arrays.asList(groupAccreditables));
         }
-
         return (Accreditable[]) accreditables.toArray(new Accreditable[accreditables.size()]);
     }
-
     /**
      * @see java.lang.Object#toString()
      */
     public String toString() {
         String accrString = "";
         Accreditable[] accreditables = getAccreditables();
-
         for (int i = 0; i < accreditables.length; i++) {
             accrString += (" " + accreditables[i]);
         }
-
         String string = "[identity:" + accrString + "]";
-
         return string;
     }
-    
     /**
      * Checks if this identity belongs to a certain accreditable manager.
-     * @param manager The accreditable manager to check for.
+     * 
+     * @param manager
+     *            The accreditable manager to check for.
      * @return A boolean value.
      * 
-     * @throws AccessControlException if an error occurs
+     * @throws AccessControlException
+     *             if an error occurs
      */
     public boolean belongsTo(AccreditableManager manager) throws AccessControlException {
-        
         boolean belongs = true;
-        
         Identifiable identifiables[] = getIdentifiables();
         int i = 0;
         while (belongs && i < identifiables.length) {
@@ -140,12 +127,11 @@
             }
             i++;
         }
-        
         return belongs;
     }
-
     /**
      * Returns the user of this identity.
+     * 
      * @return A user.
      */
     public User getUser() {
@@ -159,10 +145,10 @@
             i++;
         }
         return user;
-     }
-
+    }
     /**
      * Returns the machine of this identity.
+     * 
      * @return A machine.
      */
     public Machine getMachine() {
@@ -176,34 +162,36 @@
             i++;
         }
         return machine;
-     }
-     
-     /**
-      * Checks if this identity contains a certain identifiable.
-      * @param identifiable The identifiable to look for.
-      * @return A boolean value.
-      */
-     public boolean contains(Identifiable identifiable) {
-         return identifiables.contains(identifiable);
-     }
-     
-     /**
-      * Fetches the identity from a session.
-      * @param session The session.
-      * @return An identity.
-      */
-     public static Identity getIdentity(Session session) {
-         Identity identity = (Identity) session.getAttribute(Identity.class.getName());
-         return identity;
-     }
-     
-     /**
-      * Removes a certain identifiable from the idenity.
-      * @param identifiable An identifiable.
-      */
-     public void removeIdentifiable(Identifiable identifiable) {
-         assert identifiables.contains(identifiable);
-         identifiables.remove(identifiable);
-     }
-
+    }
+    /**
+     * Checks if this identity contains a certain identifiable.
+     * 
+     * @param identifiable
+     *            The identifiable to look for.
+     * @return A boolean value.
+     */
+    public boolean contains(Identifiable identifiable) {
+        return identifiables.contains(identifiable);
+    }
+    /**
+     * Fetches the identity from a session.
+     * 
+     * @param session
+     *            The session.
+     * @return An identity.
+     */
+    public static Identity getIdentity(Session session) {
+        Identity identity = (Identity) session.getAttribute(Identity.class.getName());
+        return identity;
+    }
+    /**
+     * Removes a certain identifiable from the idenity.
+     * 
+     * @param identifiable
+     *            An identifiable.
+     */
+    public void removeIdentifiable(Identifiable identifiable) {
+        // assert identifiables.contains(identifiable);
+        identifiables.remove(identifiable);
+    }
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Machine.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Machine.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Machine.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Machine.java Tue Sep 11 14:39:37 2007
@@ -14,7 +14,6 @@
  *  limitations under the License.
  *
  */
-
 package org.apache.lenya.ac;
 
 import java.io.Serializable;
@@ -25,55 +24,49 @@
 
 /**
  * A machine (representing an IP address).
+ * 
  * @version $Id$
  */
 public class Machine implements Identifiable, Serializable {
-
     /**
-     * Creates a new machine object. This method accepts
-     * numeric IPv4 addresses like <code>"129.168.0.32"</code>,
-     * numeric IPv6 addresses like <code>"1080::8:800:200C:417A"</code>
-     * as well as hostnames (if DNS resolution is available) like
-     * <code>"localhost"</code> or <code>"www.apache.com"</code>.
-     * 
-     * @param ip a <code>String</code> like <code>"192.168.0.32"</code>,
-     *      <code>"::1"</code>, ...
-     * .
-     * @throws AccessControlException when the conversion of the
-     *      <code>String</code> to an <code>InetAddress</code> failed
+     * Creates a new machine object. This method accepts numeric IPv4 addresses
+     * like <code>"129.168.0.32"</code>, numeric IPv6 addresses like
+     * <code>"1080::8:800:200C:417A"</code> as well as hostnames (if DNS
+     * resolution is available) like <code>"localhost"</code> or
+     * <code>"www.apache.com"</code>.
+     * 
+     * @param ip
+     *            a <code>String</code> like <code>"192.168.0.32"</code>,
+     *            <code>"::1"</code>, ... .
+     * @throws AccessControlException
+     *             when the conversion of the <code>String</code> to an
+     *             <code>InetAddress</code> failed
      */
     public Machine(String ip) throws AccessControlException {
         try {
             setAddress(InetAddress.getByName(ip));
-        } catch(UnknownHostException uhe) {
-            throw new AccessControlException
-                ("Failed to convert address [" + ip + "]: ", uhe);
+        } catch (UnknownHostException uhe) {
+            throw new AccessControlException("Failed to convert address [" + ip + "]: ", uhe);
         }
     }
-
     private InetAddress address;
-
     /**
      * @see java.lang.Object#equals(Object)
      */
     public boolean equals(Object otherObject) {
         boolean equals = false;
-
         if (otherObject instanceof Machine) {
             Machine otherMachine = (Machine) otherObject;
             equals = getAddress().equals(otherMachine.getAddress());
         }
-
         return equals;
     }
-
     /**
      * @see java.lang.Object#hashCode()
      */
     public int hashCode() {
         return getAddress().hashCode();
     }
-
     /**
      * @see org.apache.lenya.ac.Accreditable#getAccreditables()
      */
@@ -82,32 +75,32 @@
         Accreditable[] accreditables = new Accreditable[ranges.length + 1];
         accreditables[0] = this;
         for (int i = 0; i < ranges.length; i++) {
-            accreditables[i+1] = ranges[i];
+            accreditables[i + 1] = ranges[i];
         }
         return accreditables;
     }
-
     /**
      * Returns the IP address.
+     * 
      * @return The IP address.
      */
     public String getIp() {
         return getAddress().getHostAddress();
     }
-
     /**
      * Converts a string to an IP addres.
-     * @param string The IP address, represented by a string.
+     * 
+     * @param string
+     *            The IP address, represented by a string.
      * @return An InetAddress object.
-     * @throws AccessControlException when something went wrong.
+     * @throws AccessControlException
+     *             when something went wrong.
      * 
-     * @deprecated This method is unnecessary and does not work for IPv6.
-     *      Use <code>InetAddress.getByName(string)</code> instead!
+     * @deprecated This method is unnecessary and does not work for IPv6. Use
+     *             <code>InetAddress.getByName(string)</code> instead!
      */
-    public static InetAddress getAddress(String string)
-        throws AccessControlException {
+    public static InetAddress getAddress(String string) throws AccessControlException {
         String[] strings = string.split("\\.");
-
         InetAddress address;
         try {
             byte[] numbers = new byte[strings.length];
@@ -118,57 +111,53 @@
                 }
                 numbers[i] = (byte) number;
             }
-
             address = InetAddress.getByAddress(numbers);
         } catch (Exception e) {
-            throw new AccessControlException(
-                "Failed to convert address [" + string + "]: ",
-                e);
+            throw new AccessControlException("Failed to convert address [" + string + "]: ", e);
         }
         return address;
     }
-
     /**
      * @see java.lang.Object#toString()
      */
     public String toString() {
         return getIp();
     }
-
     /**
      * Returns the IP address.
+     * 
      * @return An IP address.
      */
     public InetAddress getAddress() {
         return address;
     }
-
     /**
      * Sets the IP address.
-     * @param address An IP address.
+     * 
+     * @param address
+     *            An IP address.
      */
     public void setAddress(InetAddress address) {
         this.address = address;
     }
-
     private List ipRanges = new ArrayList();
-    
     /**
      * Adds an IP range to this machine.
-     * @param range An IP range this machine belongs to.
+     * 
+     * @param range
+     *            An IP range this machine belongs to.
      */
     public void addIPRange(IPRange range) {
-        assert range != null;
-        assert !ipRanges.contains(range);
+        // assert range != null;
+        // assert !ipRanges.contains(range);
         ipRanges.add(range);
     }
-    
     /**
      * Returns the IP ranges this machine belongs to.
+     * 
      * @return An array of IP ranges.
      */
     public IPRange[] getIPRanges() {
         return (IPRange[]) ipRanges.toArray(new IPRange[ipRanges.size()]);
     }
-    
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java Tue Sep 11 14:39:37 2007
@@ -14,9 +14,7 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.ac.file;
 
 import java.io.File;
@@ -24,7 +22,6 @@
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
-
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.Configurable;
@@ -43,76 +40,68 @@
 import org.apache.lenya.ac.UserManager;
 import org.apache.lenya.ac.UserType;
 import org.apache.lenya.ac.impl.AbstractAccreditableManager;
-
 import org.apache.cocoon.util.NetUtils;
 
 /**
  * File-based accreditable manager.
  */
-public class FileAccreditableManager extends AbstractAccreditableManager implements Serviceable,
-        Configurable, Parameterizable {
-
+public class FileAccreditableManager extends AbstractAccreditableManager implements Serviceable, Configurable, Parameterizable {
     /**
-     * Creates a new FileAccreditableManager. If you use this constructor, you have to set the
-     * configuration directory either by calling {@link #setConfigurationDirectory(File)}or by
-     * calling {@link #parameterize(Parameters)}.
+     * Creates a new FileAccreditableManager. If you use this constructor, you
+     * have to set the configuration directory either by calling
+     * {@link #setConfigurationDirectory(File)}or by calling
+     * {@link #parameterize(Parameters)}.
      */
     public FileAccreditableManager() {
     }
-
     /**
      * Creates a new FileAccessController based on a configuration directory.
      * 
-     * @param configurationDirectory The configuration directory.
-     * @param userTypes The supported user types.
+     * @param configurationDirectory
+     *            The configuration directory.
+     * @param userTypes
+     *            The supported user types.
      */
     public FileAccreditableManager(File configurationDirectory, UserType[] userTypes) {
-        assert configurationDirectory != null;
-        assert configurationDirectory.exists();
-        assert configurationDirectory.isDirectory();
+        // assert configurationDirectory != null;
+        // assert configurationDirectory.exists();
+        // assert configurationDirectory.isDirectory();
         this.configurationDirectory = configurationDirectory;
         this.userTypes = new HashSet(Arrays.asList(userTypes));
     }
-
     private File configurationDirectory;
     private Set userTypes;
-
     /**
      * Returns the supported user types.
+     * 
      * @return An array of user types.
-     * @throws AccessControlException if an error occurs.
+     * @throws AccessControlException
+     *             if an error occurs.
      */
     public UserType[] getUserTypes() throws AccessControlException {
         if (userTypes == null)
             throw new AccessControlException("User types not initialized");
         return (UserType[]) userTypes.toArray(new UserType[userTypes.size()]);
     }
-
     /**
      * Returns the configuration directory.
      * 
      * @return The configuration directory.
-     * @throws AccessControlException when something went wrong.
+     * @throws AccessControlException
+     *             when something went wrong.
      */
     public File getConfigurationDirectory() throws AccessControlException {
-
         if (configurationDirectory == null) {
-
             if (configurationDirectoryPath == null) {
                 throw new AccessControlException("Configuration directory not set!");
             }
-
             Source source = null;
             SourceResolver resolver = null;
             File directory;
             try {
-
-                getLogger().debug(
-                        "Configuration directory Path: [" + configurationDirectoryPath + "]");
-
+                getLogger().debug("Configuration directory Path: [" + configurationDirectoryPath + "]");
                 resolver = (SourceResolver) getManager().lookup(SourceResolver.ROLE);
                 source = resolver.resolveURI(configurationDirectoryPath);
-
                 getLogger().debug("Configuration directory URI: " + source.getURI());
                 directory = new File(new URI(NetUtils.encodePath(source.getURI())));
             } catch (Exception e) {
@@ -127,12 +116,9 @@
             }
             setConfigurationDirectory(directory);
         }
-
         return configurationDirectory;
     }
-
     protected static final String DIRECTORY = "directory";
-
     /**
      * @see org.apache.avalon.framework.parameters.Parameterizable#parameterize(org.apache.avalon.framework.parameters.Parameters)
      */
@@ -142,7 +128,6 @@
             getLogger().debug("Configuration directory: [" + configurationDirectoryPath + "]");
         }
     }
-
     protected static final String A_M_TAG = "accreditable-manager";
     protected static final String U_M_CHILD_TAG = "user-manager";
     protected static final String U_T_CHILD_TAG = "user-type";
@@ -152,7 +137,6 @@
     protected static final String DEFAULT_USER_TYPE_CLASS = FileUser.class.getName();
     protected static final String DEFAULT_USER_TYPE_KEY = "Local User";
     protected static final String DEFAULT_USER_CREATE_USE_CASE = "userAddUser";
-
     /**
      * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
      *      added to read new user-manager block within accreditable-manager
@@ -171,13 +155,10 @@
             if (umConf != null) {
                 Configuration[] typeConfs = umConf.getChildren();
                 for (int i = 0; i < typeConfs.length; i++) {
-                    userTypes.add(new UserType(typeConfs[i].getValue(), typeConfs[i]
-                            .getAttribute(U_T_CLASS_ATTRIBUTE), typeConfs[i]
-                            .getAttribute(U_T_CREATE_ATTRIBUTE)));
+                    userTypes.add(new UserType(typeConfs[i].getValue(), typeConfs[i].getAttribute(U_T_CLASS_ATTRIBUTE), typeConfs[i].getAttribute(U_T_CREATE_ATTRIBUTE)));
                 }
             } else {
-                getLogger().debug(
-                        "FileAccreditableManager: using default configuration for user types");
+                getLogger().debug("FileAccreditableManager: using default configuration for user types");
                 // no "user-manager" block in access control: provide
                 // a default for backward compatibility
                 userTypes.add(getDefaultUserType());
@@ -186,45 +167,42 @@
             // types, for example, check if the classes are in the classpath ?
         }
     }
-
     /**
      * Returns the default user type.
+     * 
      * @return A user type.
      */
     public static UserType getDefaultUserType() {
-        return new UserType(DEFAULT_USER_TYPE_KEY, DEFAULT_USER_TYPE_CLASS,
-                DEFAULT_USER_CREATE_USE_CASE);
+        return new UserType(DEFAULT_USER_TYPE_KEY, DEFAULT_USER_TYPE_CLASS, DEFAULT_USER_CREATE_USE_CASE);
     }
-
     private String configurationDirectoryPath;
-
     /**
      * Sets the configuration directory.
      * 
-     * @param file The configuration directory.
+     * @param file
+     *            The configuration directory.
      * 
-     * @throws AccessControlException if an error occurs
+     * @throws AccessControlException
+     *             if an error occurs
      */
     public void setConfigurationDirectory(File file) throws AccessControlException {
         if (file == null || !file.isDirectory()) {
-            throw new AccessControlException("Configuration directory [" + file
-                    + "] does not exist!");
+            throw new AccessControlException("Configuration directory [" + file + "] does not exist!");
         }
         configurationDirectory = file;
     }
-
     private ServiceManager manager;
-
     /**
      * Set the global component manager.
      * 
-     * @param manager The global component manager
-     * @throws ServiceException when something went wrong.
+     * @param manager
+     *            The global component manager
+     * @throws ServiceException
+     *             when something went wrong.
      */
     public void service(ServiceManager manager) throws ServiceException {
         this.manager = manager;
     }
-
     /**
      * Returns the service manager.
      * 
@@ -233,33 +211,28 @@
     protected ServiceManager getManager() {
         return manager;
     }
-
     /**
      * @see org.apache.lenya.ac.impl.AbstractAccreditableManager#initializeGroupManager()
      */
     protected GroupManager initializeGroupManager() throws AccessControlException {
         return FileGroupManager.instance(getConfigurationDirectory());
     }
-
     /**
      * @see org.apache.lenya.ac.impl.AbstractAccreditableManager#initializeIPRangeManager()
      */
     protected IPRangeManager initializeIPRangeManager() throws AccessControlException {
         return FileIPRangeManager.instance(getConfigurationDirectory());
     }
-
     /**
      * @see org.apache.lenya.ac.impl.AbstractAccreditableManager#initializeRoleManager()
      */
     protected RoleManager initializeRoleManager() throws AccessControlException {
         return FileRoleManager.instance(getConfigurationDirectory());
     }
-
     /**
      * @see org.apache.lenya.ac.impl.AbstractAccreditableManager#initializeUserManager()
      */
     protected UserManager initializeUserManager() throws AccessControlException {
         return FileUserManager.instance(getConfigurationDirectory(), getUserTypes());
     }
-
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroup.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroup.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroup.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroup.java Tue Sep 11 14:39:37 2007
@@ -14,13 +14,10 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.ac.file;
 
 import java.io.File;
-
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
@@ -34,7 +31,6 @@
  * File-based group implementation.
  */
 public class FileGroup extends AbstractGroup implements Item {
-    
     /**
      * @see org.apache.lenya.ac.Group#delete()
      */
@@ -42,34 +38,37 @@
         super.delete();
         getFile().delete();
     }
-
     /**
      * Creates a new FileGroup object.
      */
     public FileGroup() {
     }
-
     /**
      * Create a new instance of <code>FileGroup</code>
-     * @param configurationDirectory to which the group will be attached to
-     * @param id the ID of the group
-         */
+     * 
+     * @param configurationDirectory
+     *            to which the group will be attached to
+     * @param id
+     *            the ID of the group
+     */
     public FileGroup(File configurationDirectory, String id) {
         super(id);
         setConfigurationDirectory(configurationDirectory);
     }
-
     /**
      * Configures this file group.
-     * @param config The configuration.
-     * @throws ConfigurationException when something went wrong.
+     * 
+     * @param config
+     *            The configuration.
+     * @throws ConfigurationException
+     *             when something went wrong.
      */
     public void configure(Configuration config) throws ConfigurationException {
         new ItemConfiguration().configure(this, config);
     }
-    
     /**
      * Returns the configuration file.
+     * 
      * @return A file object.
      */
     protected File getFile() {
@@ -77,56 +76,51 @@
         File xmlFile = new File(xmlPath, getId() + FileGroupManager.SUFFIX);
         return xmlFile;
     }
-
     /**
      * Save this group
-     *
-     * @throws AccessControlException if the save failed
+     * 
+     * @throws AccessControlException
+     *             if the save failed
      */
     public void save() throws AccessControlException {
         DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
         Configuration config = createConfiguration();
         File xmlfile = getFile();
-
         try {
             serializer.serializeToFile(xmlfile, config);
         } catch (Exception e) {
             throw new AccessControlException(e);
         }
     }
-
     /**
      * Group configuration element.
      */
     public static final String GROUP = "group";
-
     /**
      * Create a configuration containing the group details
-     *
+     * 
      * @return a <code>Configuration</code>
      */
     private Configuration createConfiguration() {
         DefaultConfiguration config = new DefaultConfiguration(GROUP);
         new ItemConfiguration().save(this, config);
-
         return config;
     }
-
     private File configurationDirectory;
-
     /**
      * Returns the configuration directory.
+     * 
      * @return A file object.
      */
     protected File getConfigurationDirectory() {
         return configurationDirectory;
     }
-
     /**
      * @see org.apache.lenya.ac.Item#setConfigurationDirectory(java.io.File)
      */
     public void setConfigurationDirectory(File configurationDirectory) {
-        assert (configurationDirectory != null) && configurationDirectory.isDirectory();
+        // assert (configurationDirectory != null) &&
+        // configurationDirectory.isDirectory();
         this.configurationDirectory = configurationDirectory;
     }
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroupManager.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroupManager.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroupManager.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileGroupManager.java Tue Sep 11 14:39:37 2007
@@ -14,15 +14,12 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.ac.file;
 
 import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
-
 import org.apache.lenya.ac.AccessControlException;
 import org.apache.lenya.ac.Group;
 import org.apache.lenya.ac.GroupManager;
@@ -32,41 +29,38 @@
  * File-based group manager.
  */
 public final class FileGroupManager extends FileItemManager implements GroupManager {
-
     private static Map instances = new HashMap();
-
     /**
      * Create a GroupManager
-     *
-     * @param configurationDirectory for which the GroupManager is to be created
-     * @throws AccessControlException if no GroupManager could be instanciated
+     * 
+     * @param configurationDirectory
+     *            for which the GroupManager is to be created
+     * @throws AccessControlException
+     *             if no GroupManager could be instanciated
      */
     private FileGroupManager(File configurationDirectory) throws AccessControlException {
         super(configurationDirectory);
     }
-
     /**
-     * Return the <code>GroupManager</code> for the given publication.
-     * The <code>GroupManager</code> is a singleton.
-     *
-     * @param configurationDirectory for which the GroupManager is requested
+     * Return the <code>GroupManager</code> for the given publication. The
+     * <code>GroupManager</code> is a singleton.
+     * 
+     * @param configurationDirectory
+     *            for which the GroupManager is requested
      * @return a <code>GroupManager</code>
-     * @throws AccessControlException if no GroupManager could be instanciated
+     * @throws AccessControlException
+     *             if no GroupManager could be instanciated
      */
-    public static FileGroupManager instance(File configurationDirectory)
-        throws AccessControlException {
-        assert configurationDirectory != null;
-
+    public static FileGroupManager instance(File configurationDirectory) throws AccessControlException {
+        // assert configurationDirectory != null;
         if (!instances.containsKey(configurationDirectory)) {
             instances.put(configurationDirectory, new FileGroupManager(configurationDirectory));
         }
-
         return (FileGroupManager) instances.get(configurationDirectory);
     }
-
     /**
      * Get all groups
-     *
+     * 
      * @return an array of groups.
      */
     public Group[] getGroups() {
@@ -77,44 +71,44 @@
         }
         return groups;
     }
-
     /**
      * Add a group to this manager
-     *
-     * @param group the group to be added
-     * @throws AccessControlException when the notification failed.
+     * 
+     * @param group
+     *            the group to be added
+     * @throws AccessControlException
+     *             when the notification failed.
      */
     public void add(Group group) throws AccessControlException {
         super.add(group);
     }
-
     /**
      * Remove a group from this manager
-     *
-     * @param group the group to be removed
-     * @throws AccessControlException when the notification failed.
+     * 
+     * @param group
+     *            the group to be removed
+     * @throws AccessControlException
+     *             when the notification failed.
      */
     public void remove(Group group) throws AccessControlException {
         super.remove(group);
     }
-
     /**
      * Get the group with the given group name.
-     *
-     * @param groupId the id of the requested group
-     * @return a <code>Group</code> or null if there is no group with the given name
+     * 
+     * @param groupId
+     *            the id of the requested group
+     * @return a <code>Group</code> or null if there is no group with the
+     *         given name
      */
     public Group getGroup(String groupId) {
         return (Group) getItem(groupId);
     }
-
     protected static final String SUFFIX = ".gml";
-    
     /**
      * @see org.apache.lenya.ac.file.FileItemManager#getSuffix()
      */
     protected String getSuffix() {
         return SUFFIX;
     }
-
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRangeManager.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRangeManager.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRangeManager.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRangeManager.java Tue Sep 11 14:39:37 2007
@@ -14,15 +14,12 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.ac.file;
 
 import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
-
 import org.apache.lenya.ac.AccessControlException;
 import org.apache.lenya.ac.IPRange;
 import org.apache.lenya.ac.IPRangeManager;
@@ -32,52 +29,47 @@
  * Manager for IP address ranges.
  */
 public class FileIPRangeManager extends FileItemManager implements IPRangeManager {
-
     /**
      * Ctor.
-     * @param configurationDirectory The configuration directory.
-     * @throws AccessControlException when something went wrong.
+     * 
+     * @param configurationDirectory
+     *            The configuration directory.
+     * @throws AccessControlException
+     *             when something went wrong.
      */
     protected FileIPRangeManager(File configurationDirectory) throws AccessControlException {
         super(configurationDirectory);
     }
-    
     protected static final String SUFFIX = ".ipml";
-
     /**
      * @see org.apache.lenya.ac.file.FileItemManager#getSuffix()
      */
     protected String getSuffix() {
         return SUFFIX;
     }
-
     private static Map instances = new HashMap();
-    
     /**
      * Describe <code>instance</code> method here.
-     *
-     * @param configurationDirectory a directory
+     * 
+     * @param configurationDirectory
+     *            a directory
      * @return an <code>IPRangeManager</code> value
-     * @exception AccessControlException if an error occurs
+     * @exception AccessControlException
+     *                if an error occurs
      */
     public static FileIPRangeManager instance(File configurationDirectory) throws AccessControlException {
-
-        assert configurationDirectory != null;
+        // assert configurationDirectory != null;
         if (!configurationDirectory.isDirectory()) {
-            throw new AccessControlException(
-                "Configuration directory [" + configurationDirectory + "] does not exist!");
+            throw new AccessControlException("Configuration directory [" + configurationDirectory + "] does not exist!");
         }
-
         if (!instances.containsKey(configurationDirectory)) {
             instances.put(configurationDirectory, new FileIPRangeManager(configurationDirectory));
         }
-
         return (FileIPRangeManager) instances.get(configurationDirectory);
     }
-
     /**
      * Get all IP ranges.
-     *
+     * 
      * @return an array of IP ranges.
      */
     public IPRange[] getIPRanges() {
@@ -88,36 +80,37 @@
         }
         return ranges;
     }
-
     /**
      * Add the given IP range
-     *
-     * @param range IP range that is to be added
-     * @throws AccessControlException when the notification failed.
+     * 
+     * @param range
+     *            IP range that is to be added
+     * @throws AccessControlException
+     *             when the notification failed.
      */
     public void add(IPRange range) throws AccessControlException {
         super.add(range);
     }
-
     /**
      * Remove the given IP range
-     *
-     * @param range IP range that is to be removed
-     * @throws AccessControlException when the notification failed.
+     * 
+     * @param range
+     *            IP range that is to be removed
+     * @throws AccessControlException
+     *             when the notification failed.
      */
     public void remove(IPRange range) throws AccessControlException {
         super.remove(range);
     }
-
     /**
      * Get the IPRange with the given id.
-     *
-     * @param rangeId user id of requested IP range
-     * @return the requested IP range or null if there is
-     * no IP range with the given id
+     * 
+     * @param rangeId
+     *            user id of requested IP range
+     * @return the requested IP range or null if there is no IP range with the
+     *         given id
      */
     public IPRange getIPRange(String rangeId) {
         return (IPRange) getItem(rangeId);
     }
-
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileItemManager.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileItemManager.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileItemManager.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileItemManager.java Tue Sep 11 14:39:37 2007
@@ -14,9 +14,7 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.ac.file;
 
 import java.io.File;
@@ -29,7 +27,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
@@ -42,116 +39,96 @@
 import org.apache.log4j.Category;
 
 /**
- * Abstract superclass for classes that manage items loaded from configuration files.
+ * Abstract superclass for classes that manage items loaded from configuration
+ * files.
  */
 public abstract class FileItemManager {
     private static final Category log = Category.getInstance(FileItemManager.class);
-
     public static final String PATH = "config" + File.separator + "ac" + File.separator + "passwd";
-    
     private Map items = new HashMap();
     private File configurationDirectory;
     private DirectoryChangeNotifier notifier;
-
     /**
      * Create a new ItemManager
-     *
-     * @param configurationDirectory where the items are fetched from
-     * @throws AccessControlException if the item manager cannot be instantiated
+     * 
+     * @param configurationDirectory
+     *            where the items are fetched from
+     * @throws AccessControlException
+     *             if the item manager cannot be instantiated
      */
     protected FileItemManager(File configurationDirectory) throws AccessControlException {
-        assert configurationDirectory != null;
-
+        // assert configurationDirectory != null;
         if (!configurationDirectory.exists() || !configurationDirectory.isDirectory()) {
-            throw new AccessControlException(
-                "The directory [" + configurationDirectory.getAbsolutePath() + "] does not exist!");
+            throw new AccessControlException("The directory [" + configurationDirectory.getAbsolutePath() + "] does not exist!");
         }
-
         this.configurationDirectory = configurationDirectory;
         notifier = new DirectoryChangeNotifier(configurationDirectory, getFileFilter());
         loadItems();
     }
-
     /**
      * Reloads the items if an item was changed / added / removed.
-     * @throws AccessControlException when something went wrong.
+     * 
+     * @throws AccessControlException
+     *             when something went wrong.
      */
     protected void loadItems() throws AccessControlException {
-
         boolean changed;
         try {
             changed = notifier.hasChanged();
         } catch (IOException e) {
             throw new AccessControlException(e);
         }
-
         if (changed) {
-
             if (log.isDebugEnabled()) {
                 log.debug("Item configuration has changed - reloading.");
             }
-
             File[] addedFiles = notifier.getAddedFiles();
-
             for (int i = 0; i < addedFiles.length; i++) {
                 Item item = loadItem(addedFiles[i]);
                 add(item);
             }
-
             File[] removedFiles = notifier.getRemovedFiles();
             for (int i = 0; i < removedFiles.length; i++) {
                 String fileName = removedFiles[i].getName();
                 String id = fileName.substring(0, fileName.length() - getSuffix().length());
-
                 Item item = (Item) items.get(id);
-
                 if (item != null) {
-
                     if (item instanceof Groupable) {
                         ((Groupable) item).removeFromAllGroups();
                     }
                     if (item instanceof Group) {
                         ((Group) item).removeAllMembers();
                     }
-
                     remove(item);
                 }
             }
-
             File[] changedFiles = notifier.getChangedFiles();
             for (int i = 0; i < changedFiles.length; i++) {
                 Item item = loadItem(changedFiles[i]);
                 update(item);
             }
-
         }
-
     }
-
     /**
      * Loads an item from a file.
-     * @param file The file.
+     * 
+     * @param file
+     *            The file.
      * @return An item.
-     * @throws AccessControlException when something went wrong.
+     * @throws AccessControlException
+     *             when something went wrong.
      */
     protected Item loadItem(File file) throws AccessControlException {
         Configuration config = getItemConfiguration(file);
-
         String fileName = file.getName();
         String id = fileName.substring(0, fileName.length() - getSuffix().length());
         Item item = (Item) items.get(id);
-
         String klass = getItemClass(config);
         if (item == null) {
             try {
                 item = (Item) Class.forName(klass).newInstance();
             } catch (Exception e) {
-                String errorMsg =
-                    "Exception when trying to instanciate: "
-                        + klass
-                        + " with exception: "
-                        + e.fillInStackTrace();
-
+                String errorMsg = "Exception when trying to instanciate: " + klass + " with exception: " + e.fillInStackTrace();
                 // an exception occured when trying to instanciate
                 // a user.
                 log.error(errorMsg);
@@ -159,7 +136,6 @@
             }
             item.setConfigurationDirectory(configurationDirectory);
         }
-
         try {
             item.configure(config);
         } catch (ConfigurationException e) {
@@ -168,46 +144,43 @@
         }
         return item;
     }
-
     /**
      * Returns the class name of an item.
-     * @param config The item configuration.
+     * 
+     * @param config
+     *            The item configuration.
      * @return The class name.
-     * @throws AccessControlException when something went wrong.
+     * @throws AccessControlException
+     *             when something went wrong.
      */
     protected String getItemClass(Configuration config) throws AccessControlException {
         String klass = null;
-
         try {
             klass = config.getAttribute(ItemConfiguration.CLASS_ATTRIBUTE);
         } catch (ConfigurationException e) {
-            String errorMsg =
-                "Exception when extracting class name from identity file: "
-                    + klass
-                    + config.getAttributeNames();
+            String errorMsg = "Exception when extracting class name from identity file: " + klass + config.getAttributeNames();
             log.error(errorMsg);
             throw new AccessControlException(errorMsg, e);
         }
         return klass;
     }
-
     /**
      * Loads teh configuration of an item from a file.
-     * @param file The file.
+     * 
+     * @param file
+     *            The file.
      * @return A configuration.
-     * @throws AccessControlException when something went wrong.
+     * @throws AccessControlException
+     *             when something went wrong.
      */
     protected Configuration getItemConfiguration(File file) throws AccessControlException {
         DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
         Configuration config = null;
-
         try {
-            assert file.exists();
+            // assert file.e///xists();
             config = builder.buildFromFile(file);
         } catch (Exception e) {
-            String errorMsg =
-                "Exception when reading the configuration from file: " + file.getName();
-
+            String errorMsg = "Exception when reading the configuration from file: " + file.getName();
             // an exception occured when trying to read the configuration
             // from the identity file.
             log.error(errorMsg);
@@ -215,13 +188,13 @@
         }
         return config;
     }
-
     protected void removeItem(File file) {
     }
-
     /**
      * Returns an item for a given ID.
-     * @param id The id.
+     * 
+     * @param id
+     *            The id.
      * @return An item.
      */
     public Item getItem(String id) {
@@ -232,10 +205,9 @@
         }
         return (Item) items.get(id);
     }
-
     /**
      * get all items
-     *
+     * 
      * @return an array of items
      */
     public Item[] getItems() {
@@ -246,26 +218,29 @@
         }
         return (Item[]) items.values().toArray(new Item[items.values().size()]);
     }
-
     /**
      * Add an Item to this manager
-     *
-     * @param item to be added
-     * @throws AccessControlException when the notification threw this exception.
+     * 
+     * @param item
+     *            to be added
+     * @throws AccessControlException
+     *             when the notification threw this exception.
      */
     public void add(Item item) throws AccessControlException {
-        assert item != null;
+        // assert item != null;
         items.put(item.getId(), item);
         if (log.isDebugEnabled()) {
             log.debug("Item [" + item + "] added.");
         }
         notifyAdded(item);
     }
-
     /**
      * Remove an item from this manager
-     * @param item to be removed
-     * @throws AccessControlException when the notification threw this exception.
+     * 
+     * @param item
+     *            to be removed
+     * @throws AccessControlException
+     *             when the notification threw this exception.
      */
     public void remove(Item item) throws AccessControlException {
         items.remove(item.getId());
@@ -274,11 +249,13 @@
         }
         notifyRemoved(item);
     }
-
     /**
      * Update an item.
-     * @param newItem The new version of the item.
-     * @throws AccessControlException when the notification threw this exception.
+     * 
+     * @param newItem
+     *            The new version of the item.
+     * @throws AccessControlException
+     *             when the notification threw this exception.
      */
     public void update(Item newItem) throws AccessControlException {
         items.remove(newItem.getId());
@@ -287,10 +264,11 @@
             log.debug("Item [" + newItem + "] updated.");
         }
     }
-
     /**
      * Returns if the ItemManager contains an object.
-     * @param item The object.
+     * 
+     * @param item
+     *            The object.
      * @return A boolean value.
      */
     public boolean contains(Item item) {
@@ -301,18 +279,17 @@
         }
         return items.containsValue(item);
     }
-
     /**
      * Get the directory where the items are located.
-     *
+     * 
      * @return a <code>File</code>
      */
     public File getConfigurationDirectory() {
         return configurationDirectory;
     }
-
     /**
      * Get a file filter which filters for files containing items.
+     * 
      * @return a <code>FileFilter</code>
      */
     protected FileFilter getFileFilter() {
@@ -321,21 +298,20 @@
                 return (pathname.getName().endsWith(getSuffix()));
             }
         };
-
         return filter;
     }
-
     /**
      * Returns the file extension to be used.
+     * 
      * @return A string.
      */
     protected abstract String getSuffix();
-
     private List itemManagerListeners = new ArrayList();
-
     /**
      * Attaches an item manager listener to this item manager.
-     * @param listener An item manager listener.
+     * 
+     * @param listener
+     *            An item manager listener.
      */
     public void addItemManagerListener(ItemManagerListener listener) {
         log.debug("Adding listener: [" + listener + "]");
@@ -343,20 +319,23 @@
             itemManagerListeners.add(listener);
         }
     }
-
     /**
      * Removes an item manager listener from this item manager.
-     * @param listener An item manager listener.
+     * 
+     * @param listener
+     *            An item manager listener.
      */
     public void removeItemManagerListener(ItemManagerListener listener) {
         log.debug("Removing listener: [" + listener + "]");
         itemManagerListeners.remove(listener);
     }
-
     /**
      * Notifies the listeners that an item was added.
-     * @param item The item that was added.
-     * @throws AccessControlException if an error occurs.
+     * 
+     * @param item
+     *            The item that was added.
+     * @throws AccessControlException
+     *             if an error occurs.
      */
     protected void notifyAdded(Item item) throws AccessControlException {
         log.debug("Item was added: [" + item + "]");
@@ -366,11 +345,13 @@
             listener.itemAdded(item);
         }
     }
-
     /**
      * Notifies the listeners that an item was removed.
-     * @param item The item that was removed.
-     * @throws AccessControlException if an error occurs.
+     * 
+     * @param item
+     *            The item that was removed.
+     * @throws AccessControlException
+     *             if an error occurs.
      */
     protected void notifyRemoved(Item item) throws AccessControlException {
         log.debug("Item was removed: [" + item + "]");
@@ -381,57 +362,51 @@
             listener.itemRemoved(item);
         }
     }
-
     /**
      * Helper class to observe a directory for changes.
      */
     public static class DirectoryChangeNotifier {
-
         /**
          * Ctor.
-         * @param directory The directory to observe.
-         * @param filter A filter to specify the file type to observe.
+         * 
+         * @param directory
+         *            The directory to observe.
+         * @param filter
+         *            A filter to specify the file type to observe.
          */
         public DirectoryChangeNotifier(File directory, FileFilter filter) {
             this.directory = directory;
             this.filter = filter;
         }
-
         private File directory;
         private FileFilter filter;
         private Map canonicalPath2LastModified = new HashMap();
         private static final Category log = Category.getInstance(DirectoryChangeNotifier.class);
-
         private Set addedFiles = new HashSet();
         private Set removedFiles = new HashSet();
         private Set changedFiles = new HashSet();
-
         /**
-         * Checks if the directory has changed (a new file was added, a file was removed, a file has changed).
+         * Checks if the directory has changed (a new file was added, a file was
+         * removed, a file has changed).
+         * 
          * @return A boolean value.
-         * @throws IOException when something went wrong.
+         * @throws IOException
+         *             when something went wrong.
          */
         public boolean hasChanged() throws IOException {
-
             addedFiles.clear();
             removedFiles.clear();
             changedFiles.clear();
-
             File[] files = directory.listFiles(filter);
-
             Set newPathSet = new HashSet();
-
             for (int i = 0; i < files.length; i++) {
                 String canonicalPath = files[i].getCanonicalPath();
                 newPathSet.add(canonicalPath);
-
                 if (!canonicalPath2LastModified.containsKey(canonicalPath)) {
                     addedFiles.add(new File(canonicalPath));
-
                     if (log.isDebugEnabled()) {
                         log.debug("New file: [" + canonicalPath + "]");
                     }
-
                 } else {
                     Long lastModifiedObject = (Long) canonicalPath2LastModified.get(canonicalPath);
                     long lastModified = lastModifiedObject.longValue();
@@ -445,7 +420,6 @@
                 Long lastModified = new Long(files[i].lastModified());
                 canonicalPath2LastModified.put(canonicalPath, lastModified);
             }
-
             Set oldPathSet = canonicalPath2LastModified.keySet();
             String[] oldPaths = (String[]) oldPathSet.toArray(new String[oldPathSet.size()]);
             for (int i = 0; i < oldPaths.length; i++) {
@@ -457,34 +431,31 @@
                     }
                 }
             }
-
             return !addedFiles.isEmpty() || !removedFiles.isEmpty() || !changedFiles.isEmpty();
         }
-
         /**
          * Returns the added files.
+         * 
          * @return An array of files.
          */
         public File[] getAddedFiles() {
             return (File[]) addedFiles.toArray(new File[addedFiles.size()]);
         }
-
         /**
          * Returns the removed files.
+         * 
          * @return An array of files.
          */
         public File[] getRemovedFiles() {
             return (File[]) removedFiles.toArray(new File[removedFiles.size()]);
         }
-
         /**
          * Returns the changed files.
+         * 
          * @return An array of files.
          */
         public File[] getChangedFiles() {
             return (File[]) changedFiles.toArray(new File[changedFiles.size()]);
         }
-
     }
-
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUser.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUser.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUser.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUser.java Tue Sep 11 14:39:37 2007
@@ -14,12 +14,10 @@
  *  limitations under the License.
  *
  */
-
 package org.apache.lenya.ac.file;
 
 import java.io.File;
 import java.io.Serializable;
-
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
@@ -33,139 +31,119 @@
 
 /**
  * File-based user implementation.
+ * 
  * @version $Id$
  */
 public class FileUser extends AbstractUser implements Item, Serializable {
-	private static final Logger log = Logger.getLogger(FileUser.class);
-
+    private static final Logger log = Logger.getLogger(FileUser.class);
     public static final String ID = "identity";
     public static final String EMAIL = "email";
     public static final String PASSWORD = "password";
     public static final String GROUPS = "groups";
     public static final String GROUP = "group";
     public static final String PASSWORD_ATTRIBUTE = "type";
-
     /**
      * Creates a new FileUser object.
      */
     public FileUser() {
     }
-
     /**
      * Create a FileUser
-     *
-     * @param configurationDirectory where the user will be attached to
-     * @param id the user id
-     * @param fullName the full name of the user
-     * @param email the users email address
-     * @param password the users password
+     * 
+     * @param configurationDirectory
+     *            where the user will be attached to
+     * @param id
+     *            the user id
+     * @param fullName
+     *            the full name of the user
+     * @param email
+     *            the users email address
+     * @param password
+     *            the users password
      */
-    public FileUser(File configurationDirectory, String id, String fullName, String email,
-        String password) {
+    public FileUser(File configurationDirectory, String id, String fullName, String email, String password) {
         super(id, fullName, email, password);
         setConfigurationDirectory(configurationDirectory);
     }
-
     /**
      * Configure this FileUser.
-     *
-     * @param config where the user details are specified
-     * @throws ConfigurationException if the necessary details aren't specified in the config
+     * 
+     * @param config
+     *            where the user details are specified
+     * @throws ConfigurationException
+     *             if the necessary details aren't specified in the config
      */
     public void configure(Configuration config) throws ConfigurationException {
         new ItemConfiguration().configure(this, config);
         setEmail(config.getChild(EMAIL).getValue(""));
         setEncryptedPassword(config.getChild(PASSWORD).getValue(null));
-
         removeFromAllGroups();
         Configuration[] groups = config.getChildren(GROUPS);
-
         if (groups.length == 1) {
             groups = groups[0].getChildren(GROUP);
-
             FileGroupManager manager = null;
-
             try {
                 manager = FileGroupManager.instance(configurationDirectory);
             } catch (AccessControlException e) {
-                throw new ConfigurationException(
-                    "Exception when trying to fetch GroupManager for directory: [" +
-                    configurationDirectory + "]", e);
+                throw new ConfigurationException("Exception when trying to fetch GroupManager for directory: [" + configurationDirectory + "]", e);
             }
-
             for (int i = 0; i < groups.length; i++) {
                 String groupId = groups[i].getValue();
                 Group group = manager.getGroup(groupId);
-
                 if (group == null) {
                     throw new ConfigurationException("Couldn't find Group for group name [" + groupId + "]");
                 }
-                
                 if (!group.contains(this)) {
                     group.add(this);
                 }
-
             }
         } else {
             // strange, it should have groups
-            log.error("User " + getId() +
-                " doesn't seem to have any groups");
+            log.error("User " + getId() + " doesn't seem to have any groups");
         }
     }
-
-
     /**
-     * Create a configuration from the current user details. Can
-     * be used for saving.
-     *
+     * Create a configuration from the current user details. Can be used for
+     * saving.
+     * 
      * @return a <code>Configuration</code>
      */
     protected Configuration createConfiguration() {
         DefaultConfiguration config = new DefaultConfiguration(ID);
         new ItemConfiguration().save(this, config);
-
         DefaultConfiguration child = null;
-
         // add email node
         child = new DefaultConfiguration(EMAIL);
         child.setValue(getEmail());
         config.addChild(child);
-
         // add password node
         child = new DefaultConfiguration(PASSWORD);
         child.setValue(getEncryptedPassword());
         child.setAttribute(PASSWORD_ATTRIBUTE, "md5");
         config.addChild(child);
-
         // add group nodes
         child = new DefaultConfiguration(GROUPS);
         config.addChild(child);
-
         Group[] groups = getGroups();
-
         for (int i = 0; i < groups.length; i++) {
             DefaultConfiguration groupNode = new DefaultConfiguration(GROUP);
             groupNode.setValue(groups[i].getId());
             child.addChild(groupNode);
         }
-
         return config;
     }
-
     /**
      * @see org.apache.lenya.ac.User#save()
      */
     public void save() throws AccessControlException {
         DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
         Configuration config = createConfiguration();
-
         try {
             serializer.serializeToFile(getFile(), config);
         } catch (Exception e) {
             throw new AccessControlException(e);
         }
     }
-
     /**
      * @see org.apache.lenya.ac.User#delete()
      */
@@ -173,9 +151,9 @@
         super.delete();
         getFile().delete();
     }
-    
     /**
      * Returns the configuration file.
+     * 
      * @return A file object.
      */
     protected File getFile() {
@@ -183,23 +161,21 @@
         File xmlFile = new File(xmlPath, getId() + FileUserManager.SUFFIX);
         return xmlFile;
     }
-
     private File configurationDirectory;
-
     /**
      * Returns the configuration directory.
+     * 
      * @return A file object.
      */
     protected File getConfigurationDirectory() {
         return configurationDirectory;
     }
-
     /**
      * @see org.apache.lenya.ac.Item#setConfigurationDirectory(java.io.File)
      */
     public void setConfigurationDirectory(File configurationDirectory) {
-        assert (configurationDirectory != null) && configurationDirectory.isDirectory();
+        // assert (configurationDirectory != null) &&
+        // configurationDirectory.isDirectory();
         this.configurationDirectory = configurationDirectory;
     }
-    
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUserManager.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUserManager.java?rev=574702&r1=574701&r2=574702&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUserManager.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileUserManager.java Tue Sep 11 14:39:37 2007
@@ -14,7 +14,6 @@
  *  limitations under the License.
  *
  */
-
 package org.apache.lenya.ac.file;
 
 import java.io.File;
@@ -23,7 +22,6 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-
 import org.apache.lenya.ac.AccessControlException;
 import org.apache.lenya.ac.Item;
 import org.apache.lenya.ac.User;
@@ -32,51 +30,47 @@
 
 /**
  * File-based user manager implementation.
+ * 
  * @version $Id$
  */
 public class FileUserManager extends FileItemManager implements UserManager {
-
     private static Map instances = new HashMap();
     private Set userTypes;
-
     /**
      * Create a UserManager
      * 
-     * @param configurationDirectory for which the UserManager should be instanciated.
-     * @param userTypes The supported user types.
-     * @throws AccessControlException if the UserManager could not be instantiated.
+     * @param configurationDirectory
+     *            for which the UserManager should be instanciated.
+     * @param userTypes
+     *            The supported user types.
+     * @throws AccessControlException
+     *             if the UserManager could not be instantiated.
      */
-    protected FileUserManager(File configurationDirectory, UserType[] userTypes)
-            throws AccessControlException {
+    protected FileUserManager(File configurationDirectory, UserType[] userTypes) throws AccessControlException {
         super(configurationDirectory);
         this.userTypes = new HashSet(Arrays.asList(userTypes));
     }
-
     /**
      * Describe <code>instance</code> method here.
      * 
-     * @param configurationDirectory a directory
-     * @param userTypes The supported user types.
+     * @param configurationDirectory
+     *            a directory
+     * @param userTypes
+     *            The supported user types.
      * @return an <code>UserManager</code> value
-     * @exception AccessControlException if an error occurs
+     * @exception AccessControlException
+     *                if an error occurs
      */
-    public static FileUserManager instance(File configurationDirectory, UserType[] userTypes)
-            throws AccessControlException {
-
-        assert configurationDirectory != null;
+    public static FileUserManager instance(File configurationDirectory, UserType[] userTypes) throws AccessControlException {
+        // assert configurationDirectory != null;
         if (!configurationDirectory.isDirectory()) {
-            throw new AccessControlException("Configuration directory [" + configurationDirectory
-                    + "] does not exist!");
+            throw new AccessControlException("Configuration directory [" + configurationDirectory + "] does not exist!");
         }
-
         if (!instances.containsKey(configurationDirectory)) {
-            instances.put(configurationDirectory, new FileUserManager(configurationDirectory,
-                    userTypes));
+            instances.put(configurationDirectory, new FileUserManager(configurationDirectory, userTypes));
         }
-
         return (FileUserManager) instances.get(configurationDirectory);
     }
-
     /**
      * Get all users.
      * 
@@ -90,45 +84,40 @@
         }
         return users;
     }
-
     /**
      * @see org.apache.lenya.ac.UserManager#add(org.apache.lenya.ac.User)
      */
     public void add(User user) throws AccessControlException {
         super.add(user);
     }
-
     /**
      * @see org.apache.lenya.ac.UserManager#remove(org.apache.lenya.ac.User)
      */
     public void remove(User user) throws AccessControlException {
         super.remove(user);
     }
-
     /**
      * Get the user with the given user id.
      * 
-     * @param userId user id of requested user
-     * @return the requested user or null if there is no user with the given user id
+     * @param userId
+     *            user id of requested user
+     * @return the requested user or null if there is no user with the given
+     *         user id
      */
     public User getUser(String userId) {
         return (User) getItem(userId);
     }
-
     /**
      * @see org.apache.lenya.ac.UserManager#getUserTypes()
      */
     public UserType[] getUserTypes() {
         return (UserType[]) userTypes.toArray(new UserType[userTypes.size()]);
     }
-
     protected static final String SUFFIX = ".iml";
-
     /**
      * @see org.apache.lenya.ac.file.FileItemManager#getSuffix()
      */
     protected String getSuffix() {
         return SUFFIX;
     }
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org