svn commit: r617035 [1/22] - in /lenya/branches/revolution/1.3.x: ./ src/java/org/apache/lenya/ac/ src/java/org/apache/lenya/ac/cache/ src/java/org/apache/lenya/ac/cifs/ src/java/org/apache/lenya/ac/file/ src/java/org/apache/lenya/ac/impl/ src/java/org...

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: solprovider
Date: Wed Jan 30 23:44:03 2008
New Revision: 617035

URL: http://svn.apache.org/viewvc?rev=617035&view=rev
Log:
Added util.Globals - easy access to ServletContextPath and current ModuleId.
Fixed many Eclipse warnings - Category replaced with Logger, added serialVersionUID for Serializable.

Added:
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatIndexPart.java
      - copied, changed from r615136, lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/index/FlatIndexPart.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/Globals.java
Removed:
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/index/FlatIndexPart.java
Modified:
    lenya/branches/revolution/1.3.x/13TODO.txt
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/AccessControlException.java
    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/Password.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/World.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/BuildException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/CachingException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cifs/CIFSUser.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRange.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/impl/AbstractIPRange.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/impl/AbstractUser.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/ldap/LDAPUser.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ant/DeleteNodeTask.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ant/DownloadFeeds.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/authoring/CreatorException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/authoring/DefaultBranchCreator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/authoring/DefaultCreator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/authoring/DocumentCreator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/authoring/UploadHelper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/DefaultCreatorAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/OneFormEditorSaveAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/ReservedCheckinAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/ReservedCheckoutAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/RevisionControllerAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/ValidateAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/flow/FlowHelper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/generation/Configuration.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/generation/ProxyGenerator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/task/CocoonTaskWrapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/transformation/VirtualTransformer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/uriparameterizer/URIParameterizerException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/Content.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/ContentInputModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/ContentSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/Resource.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/ResourceTransformer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/CreateRevisionTransformer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatContent.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatIndex.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatIndexer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatRelations.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatResource.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatRevision.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatTranslation.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/SitetreeGenerator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/hierarchical/HierarchicalContent.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/mail/MailTask.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/Module.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/ModuleGlobal.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/ModuleInputModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/ModuleSet.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/ModuleSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/Modules.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/CollectionImpl.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/DocumentBuildException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DocumentDoesNotExistException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DocumentException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DocumentTypeBuildException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DublinCoreHelper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/DublinCoreImpl.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/NoChildDocumentExistException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/PageEnvelopeException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/PublicationException.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/PublicationModules.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/SiteTreeException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/XlinkCollection.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/publication/util/LinkRewriter.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/xsp/DocumentReferencesHelper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publishing/ExportException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publishing/ParentNodeNotFoundException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publishing/PublishingEnvironment.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publishing/PublishingException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publishing/ResourcePublishingEnvironment.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publishing/StaticHTMLExporter.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/rc/Configuration.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/rc/FileReservedCheckInException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/rc/FileReservedCheckOutException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/rc/RCEnvironment.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/rc/RCML.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/rc/RevisionControlException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/rc/RevisionController.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/AbstractSchedulerListener.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/SchedulerStore.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/ServletJob.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/ServletJobFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/TaskJob.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/xml/TriggerHelper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/DefaultTaskWrapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/ExecutionException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/LuceneTask.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/Notifier.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/ParameterWrapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/TaskFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/TaskManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/TaskSequence.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/lucene/IndexConfiguration.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/HTMLParserTokenManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/html/ParseException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/html/TokenMgrError.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/ConfigurableDocumentCreator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/index/ConfigurableIndexer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/index/IndexInformation.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/index/IndexIterator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/parser/HTMLParserFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/parser/ParseException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/parser/PreParser.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/parser/SwingHTMLHandler.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/lucene/parser/SwingHTMLParser.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/net/Configuration.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/net/InetAddressUtil.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/net/ProxyManager.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/net/SMTP.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/net/WGet.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/search/crawler/CrawlerConfiguration.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/search/crawler/IterativeHTMLCrawler.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/CacheMap.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/FileUtil.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/HTMLHandler.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/Log4Echo.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/SED.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/ServletHelper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/Stack.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/XPSFileOutputStream.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/WorkflowException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/AbstractCondition.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/BooleanVariableAssignmentImpl.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/BooleanVariableCondition.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/BooleanVariableImpl.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/BooleanVariableInstanceImpl.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/SynchronizedWorkflowInstancesImpl.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/TransitionImpl.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/WorkflowBuilder.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/WorkflowImpl.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/workflow/impl/WorkflowInstanceImpl.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/Configuration.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/DOMParserFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/DOMUtil.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/MalformedXPointerException.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/RelaxNG.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/XMLEncToJavaEnc.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/XPSAssembler.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/XPSSourceInformation.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/XPointerFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/xpointer/XalanXPointer.java

Modified: lenya/branches/revolution/1.3.x/13TODO.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13TODO.txt?rev=617035&r1=617034&r2=617035&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13TODO.txt (original)
+++ lenya/branches/revolution/1.3.x/13TODO.txt Wed Jan 30 23:44:03 2008
@@ -1,15 +1,3 @@
-
-BUG: Lenya-1.2-style authoring.  ERROR:
-F:\F:\lenya13\build\lenya\webapp\lenya\pubs\default12\xslt\page2xhtml.xsl (The filename, directory name, or volume label syntax is incorrect)
-rg.apache.cocoon.ProcessingException: Unable to get transformer handler for F:///F:/lenya13/build/lenya/webapp/lenya/modules/authoring/../../pubs/default12/xslt/page2xhtml-homepage.xsl
-	at [TransformerException] - file:///F:///F:/lenya13/build/lenya/webapp/lenya/modules/authoring/../../pubs/default12/xslt/page2xhtml-homepage.xsl:22:36
-	at <map:serialize type="xml"> - file:///F:/lenya13/build/lenya/webapp/lenya/modules/authoring/module.xmap:145:36
-	at <map:transform type="link-rewrite"> - file:///F:/lenya13/build/lenya/webapp/lenya/modules/authoring/module.xmap:142:44
-
-default12/xslt/page2xhtml-homepage.xsl cannot open page2xhtml.xsl because drive letter is duplicated:
-file:///F:///F:/lenya13/build/lenya/webapp/lenya/modules/authoring/../../pubs/default12/xslt/page2xhtml-homepage.xsl
----
-
 Create New Resource: Publication has Resource Types.  Use Generator. Choose Type.  Create required languages. Use Transformer. Pass to Edit Module.
 
 Edit-Save must clear Cache.

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/AccessControlException.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/AccessControlException.java?rev=617035&r1=617034&r2=617035&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/AccessControlException.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/AccessControlException.java Wed Jan 30 23:44:03 2008
@@ -14,47 +14,48 @@
  *  limitations under the License.
  *
  */
-
 package org.apache.lenya.ac;
-
 /**
  * Access control exception.
+ * 
  * @version $Id$
  */
 public class AccessControlException extends Exception {
-    /**
-     * Create an AccessControlException
-     *
-     */
-    public AccessControlException() {
-        super();
-    }
-
-    /**
-     * Create an AccessControlException
-     *
-     * @param message The message.
-     */
-    public AccessControlException(String message) {
-        super(message);
-    }
-
-    /**
-     * Create an AccessControlException
-     *
-     * @param message The message.
-     * @param cause The cause.
-     */
-    public AccessControlException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Create an AccessControlException.
-     *
-     * @param cause The cause.
-     */
-    public AccessControlException(Throwable cause) {
-        super(cause);
-    }
+   private static final long serialVersionUID = 1L;
+   /**
+    * Create an AccessControlException
+    * 
+    */
+   public AccessControlException() {
+      super();
+   }
+   /**
+    * Create an AccessControlException
+    * 
+    * @param message
+    *           The message.
+    */
+   public AccessControlException(String message) {
+      super(message);
+   }
+   /**
+    * Create an AccessControlException
+    * 
+    * @param message
+    *           The message.
+    * @param cause
+    *           The cause.
+    */
+   public AccessControlException(String message, Throwable cause) {
+      super(message, cause);
+   }
+   /**
+    * Create an AccessControlException.
+    * 
+    * @param cause
+    *           The cause.
+    */
+   public AccessControlException(Throwable cause) {
+      super(cause);
+   }
 }

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=617035&r1=617034&r2=617035&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 Wed Jan 30 23:44:03 2008
@@ -16,182 +16,178 @@
  */
 /* $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;
-
+import org.apache.log4j.Logger;
 /**
- * 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
-     */
-    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());
-        }
-        out.defaultWriteObject();
-        out.writeObject(identifiables);
-    }
-    /**
-     * 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());
-        }
-    }
-    /**
-     * 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.
-     */
-    public void addIdentifiable(Identifiable 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.
-     * @return A boolean value.
-     * 
-     * @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) {
-            if (identifiables[i] instanceof User) {
-                User user = (User) identifiables[i];
-                User otherUser = manager.getUserManager().getUser(user.getId());
-                belongs = belongs && user == otherUser;
-            }
-            i++;
-        }
-        return belongs;
-    }
-    /**
-     * Returns the user of this identity.
-     * 
-     * @return A user.
-     */
-    public User getUser() {
-        User user = null;
-        Identifiable[] identifiables = getIdentifiables();
-        int i = 0;
-        while (user == null && i < identifiables.length) {
-            if (identifiables[i] instanceof User) {
-                user = (User) identifiables[i];
-            }
-            i++;
-        }
-        return user;
-    }
-    /**
-     * Returns the machine of this identity.
-     * 
-     * @return A machine.
-     */
-    public Machine getMachine() {
-        Machine machine = null;
-        Identifiable[] identifiables = getIdentifiables();
-        int i = 0;
-        while (machine == null && i < identifiables.length) {
-            if (identifiables[i] instanceof Machine) {
-                machine = (Machine) identifiables[i];
-            }
-            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);
-    }
+   private static final long serialVersionUID = 1L;
+   private Set identifiables = new HashSet();
+   private static Logger log = Logger.getLogger(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
+    */
+   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());
+      }
+      out.defaultWriteObject();
+      out.writeObject(identifiables);
+   }
+   /**
+    * 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());
+      }
+   }
+   /**
+    * 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.
+    */
+   public void addIdentifiable(Identifiable 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.
+    * @return A boolean value.
+    * 
+    * @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){
+         if(identifiables[i] instanceof User){
+            User user = (User) identifiables[i];
+            User otherUser = manager.getUserManager().getUser(user.getId());
+            belongs = belongs && user == otherUser;
+         }
+         i++;
+      }
+      return belongs;
+   }
+   /**
+    * Returns the user of this identity.
+    * 
+    * @return A user.
+    */
+   public User getUser() {
+      User user = null;
+      Identifiable[] identifiables = getIdentifiables();
+      int i = 0;
+      while(user == null && i < identifiables.length){
+         if(identifiables[i] instanceof User){
+            user = (User) identifiables[i];
+         }
+         i++;
+      }
+      return user;
+   }
+   /**
+    * Returns the machine of this identity.
+    * 
+    * @return A machine.
+    */
+   public Machine getMachine() {
+      Machine machine = null;
+      Identifiable[] identifiables = getIdentifiables();
+      int i = 0;
+      while(machine == null && i < identifiables.length){
+         if(identifiables[i] instanceof Machine){
+            machine = (Machine) identifiables[i];
+         }
+         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);
+   }
 }

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=617035&r1=617034&r2=617035&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 Wed Jan 30 23:44:03 2008
@@ -28,7 +28,8 @@
  * @version $Id$
  */
 public class Machine implements Identifiable, Serializable {
-    /**
+    private static final long serialVersionUID = 1L;
+   /**
      * 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

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Password.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Password.java?rev=617035&r1=617034&r2=617035&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Password.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/Password.java Wed Jan 30 23:44:03 2008
@@ -14,81 +14,73 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.ac;
-
 import java.security.MessageDigest;
-
-import org.apache.log4j.Category;
-
+import org.apache.log4j.Logger;
 /**
- * Encrypt plain text password
- * Example: "message digest" becomes "f96b697d7cb7938d525a2f31aaf161d0" (hexadecimal notation (32 characters))
+ * Encrypt plain text password Example: "message digest" becomes "f96b697d7cb7938d525a2f31aaf161d0" (hexadecimal notation (32 characters))
  */
 public class Password {
-    private static Category log = Category.getInstance(Password.class);
-
-    /**
-     * CLI
-     *
-     * @param args plain text password
-     */
-    public static void main(String[] args) {
-        if (args.length != 1) {
-            System.out.println("Usage: plain-text-password");
-
-            return;
-        }
-
-        try {
-            System.out.println(Password.encrypt(args[0]));
-        } catch (Exception e) {
-            System.err.println(e);
-        }
-    }
-
-    /**
-     * Encrypt plain text password
-     *
-     * @param plain plain text password
-     * @return encrypted password
-     */
-    public static String encrypt(String plain) {
-        return getMD5(plain);
-    }
-
-    /**
-     * Returns the MD5 representation of a string.
-     * @param plain The plain string.
-     * @return A string.
-     */
-    public static String getMD5(String plain) {
-        MessageDigest md = null;
-        try {
-            md = MessageDigest.getInstance("MD5");
-        } catch (java.security.NoSuchAlgorithmException e) {
-            log.error(e);
-        }
-        return stringify(md.digest(plain.getBytes()));
-    }
-
-    /**
-     * Converts a byte buffer to a string.
-     * @param buf The buffer.
-     * @return A string.
-     */
-    private static String stringify(byte[] buf) {
-        StringBuffer sb = new StringBuffer(2 * buf.length);
-
-        for (int i = 0; i < buf.length; i++) {
-            int h = (buf[i] & 0xf0) >> 4;
-            int l = (buf[i] & 0x0f);
-            sb.append(new Character((char) ((h > 9) ? (('a' + h) - 10) : ('0' + h))));
-            sb.append(new Character((char) ((l > 9) ? (('a' + l) - 10) : ('0' + l))));
-        }
-
-        return sb.toString();
-    }
+   private static Logger log = Logger.getLogger(Password.class);
+   /**
+    * CLI
+    * 
+    * @param args
+    *           plain text password
+    */
+   public static void main(String[] args) {
+      if(args.length != 1){
+         System.out.println("Usage: plain-text-password");
+         return;
+      }
+      try{
+         System.out.println(Password.encrypt(args[0]));
+      }catch(Exception e){
+         System.err.println(e);
+      }
+   }
+   /**
+    * Encrypt plain text password
+    * 
+    * @param plain
+    *           plain text password
+    * @return encrypted password
+    */
+   public static String encrypt(String plain) {
+      return getMD5(plain);
+   }
+   /**
+    * Returns the MD5 representation of a string.
+    * 
+    * @param plain
+    *           The plain string.
+    * @return A string.
+    */
+   public static String getMD5(String plain) {
+      MessageDigest md = null;
+      try{
+         md = MessageDigest.getInstance("MD5");
+      }catch(java.security.NoSuchAlgorithmException e){
+         log.error(e);
+      }
+      return stringify(md.digest(plain.getBytes()));
+   }
+   /**
+    * Converts a byte buffer to a string.
+    * 
+    * @param buf
+    *           The buffer.
+    * @return A string.
+    */
+   private static String stringify(byte[] buf) {
+      StringBuffer sb = new StringBuffer(2 * buf.length);
+      for(int i = 0; i < buf.length; i++){
+         int h = (buf[i] & 0xf0) >> 4;
+         int l = (buf[i] & 0x0f);
+         sb.append(new Character((char) ((h > 9) ? (('a' + h) - 10) : ('0' + h))));
+         sb.append(new Character((char) ((l > 9) ? (('a' + l) - 10) : ('0' + l))));
+      }
+      return sb.toString();
+   }
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/World.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/World.java?rev=617035&r1=617034&r2=617035&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/World.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/World.java Wed Jan 30 23:44:03 2008
@@ -14,42 +14,37 @@
  *  limitations under the License.
  *
  */
-
 package org.apache.lenya.ac;
-
 import java.io.Serializable;
 import java.util.Collections;
-
 /**
  * The world.
+ * 
  * @version $Id$
  */
 public final class World implements Identifiable, Serializable {
-    
-    /**
-     * Creates a new World object.
-     */
-    private World() {
-    }
-
-    private static World instance;
-
-    /**
-     * Returns the singleton world object.
-     * @return A world object.
-     */
-    public static World getInstance() {
-        if (instance == null) {
-            instance = new World();
-        }
-
-        return instance;
-    }
-
-    /**
-     * @see org.apache.lenya.ac.Accreditable#getAccreditables()
-     */
-    public Accreditable[] getAccreditables() {
-        return (Accreditable[]) Collections.singleton(this).toArray(new Accreditable[1]);
-    }
+   private static final long serialVersionUID = -7545661341416328516L;
+   /**
+    * Creates a new World object.
+    */
+   private World() {
+   }
+   private static World instance;
+   /**
+    * Returns the singleton world object.
+    * 
+    * @return A world object.
+    */
+   public static World getInstance() {
+      if(instance == null){
+         instance = new World();
+      }
+      return instance;
+   }
+   /**
+    * @see org.apache.lenya.ac.Accreditable#getAccreditables()
+    */
+   public Accreditable[] getAccreditables() {
+      return (Accreditable[]) Collections.singleton(this).toArray(new Accreditable[1]);
+   }
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/BuildException.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/BuildException.java?rev=617035&r1=617034&r2=617035&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/BuildException.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/BuildException.java Wed Jan 30 23:44:03 2008
@@ -14,46 +14,46 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.ac.cache;
-
 /**
  * Exception for problems when cacheable objects are built.
  */
 public class BuildException extends Exception {
-
-    /**
-     * Ctor.
-     */
-    public BuildException() {
-        super();
-    }
-
-    /**
-     * Ctor.
-     * @param message The message.
-     */
-    public BuildException(String message) {
-        super(message);
-    }
-
-    /**
-     * Ctor.
-     * @param message The message.
-     * @param cause The cause.
-     */
-    public BuildException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Ctor.
-     * @param cause The cause.
-     */
-    public BuildException(Throwable cause) {
-        super(cause);
-    }
-
+   private static final long serialVersionUID = 1L;
+   /**
+    * Ctor.
+    */
+   public BuildException() {
+      super();
+   }
+   /**
+    * Ctor.
+    * 
+    * @param message
+    *           The message.
+    */
+   public BuildException(String message) {
+      super(message);
+   }
+   /**
+    * Ctor.
+    * 
+    * @param message
+    *           The message.
+    * @param cause
+    *           The cause.
+    */
+   public BuildException(String message, Throwable cause) {
+      super(message, cause);
+   }
+   /**
+    * Ctor.
+    * 
+    * @param cause
+    *           The cause.
+    */
+   public BuildException(Throwable cause) {
+      super(cause);
+   }
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/CachingException.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/CachingException.java?rev=617035&r1=617034&r2=617035&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/CachingException.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cache/CachingException.java Wed Jan 30 23:44:03 2008
@@ -14,45 +14,47 @@
  *  limitations under the License.
  *
  */
-
 package org.apache.lenya.ac.cache;
-
 /**
  * Caching exception.
+ * 
  * @version $Id$
  */
 public class CachingException extends Exception {
-
-    /**
-     * Ctor.
-     */
-    public CachingException() {
-        super();
-    }
-
-    /**
-     * Ctor.
-     * @param message The message.
-     */
-    public CachingException(String message) {
-        super(message);
-    }
-
-    /**
-     * Ctor.
-     * @param message The message.
-     * @param cause The cause.
-     */
-    public CachingException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Ctor.
-     * @param cause The cause.
-     */
-    public CachingException(Throwable cause) {
-        super(cause);
-    }
-
+   private static final long serialVersionUID = 1L;
+   /**
+    * Ctor.
+    */
+   public CachingException() {
+      super();
+   }
+   /**
+    * Ctor.
+    * 
+    * @param message
+    *           The message.
+    */
+   public CachingException(String message) {
+      super(message);
+   }
+   /**
+    * Ctor.
+    * 
+    * @param message
+    *           The message.
+    * @param cause
+    *           The cause.
+    */
+   public CachingException(String message, Throwable cause) {
+      super(message, cause);
+   }
+   /**
+    * Ctor.
+    * 
+    * @param cause
+    *           The cause.
+    */
+   public CachingException(Throwable cause) {
+      super(cause);
+   }
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cifs/CIFSUser.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cifs/CIFSUser.java?rev=617035&r1=617034&r2=617035&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cifs/CIFSUser.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/cifs/CIFSUser.java Wed Jan 30 23:44:03 2008
@@ -12,160 +12,134 @@
  * the License.
  *  
  */
-
 package org.apache.lenya.ac.cifs;
-
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.net.UnknownHostException;
 import java.util.Properties;
-
-import org.apache.lenya.ac.file.FileUser;
-
-import org.apache.log4j.Category;
-import org.apache.log4j.Logger;
-
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-
+import jcifs.UniAddress;
 import jcifs.smb.NtlmPasswordAuthentication;
 import jcifs.smb.SmbAuthException;
 import jcifs.smb.SmbException;
 import jcifs.smb.SmbSession;
-
-import jcifs.UniAddress;
-import java.net.UnknownHostException;
-
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.lenya.ac.file.FileUser;
+import org.apache.log4j.Logger;
 /**
  * CIFS user.
+ * 
  * @version $Id$
  */
 public class CIFSUser extends FileUser {
-
-    private static Properties defaultProperties = null;
-    private static Category log =  Logger.getLogger(CIFSUser.class);
-
-    // The name for the cifs.properties domain controller lookup
-    private static final String DOMAIN_CONTROLLER = "domain-controller";
-
-    // The name for the cifs.properties domain name lookup
-    private static final String DOMAIN = "domain";
-
-
-    /**
+   private static final long serialVersionUID = 1L;
+   private static Properties defaultProperties = null;
+   private static Logger log = Logger.getLogger(CIFSUser.class);
+   // The name for the cifs.properties domain controller lookup
+   private static final String DOMAIN_CONTROLLER = "domain-controller";
+   // The name for the cifs.properties domain name lookup
+   private static final String DOMAIN = "domain";
+   /**
     * Creates a new CIFSUser object.
     */
-    public CIFSUser() {
-
-    }
-
-    /**
+   public CIFSUser() {
+   }
+   /**
     * Create a CIFSUser
     */
-    public CIFSUser(File configurationDirectory, String id,
-                    String fullName,String email,String password) {
-        super(configurationDirectory, id, fullName, email, password);
-
-    }
-
-    /**
-     * Initializes this user.
-     * @throws ConfigurationException when something went wrong.
-     */
-    protected void initialize() throws ConfigurationException {
-       try {
-            readProperties(super.getConfigurationDirectory());
-        } catch (final IOException ioe) {
-            throw new ConfigurationException("Reading cifs.properties file in ["+
-                        super.getConfigurationDirectory()+"] failed", ioe);
-        }
-    }
-
-    /**
-     * Create a new CIFSUser from a configuration
-     * @param config the <code>Configuration</code> specifying the user details
-     * @throws ConfigurationException if the user could not be instantiated
-     */
-    public void configure(Configuration config) throws ConfigurationException {
-        super.configure(config);
-        initialize();
-    }
-
-    /**
-     * Authenticate a user. This is done by NTDomain Authentication
-     *  using jcifs
-     * @param password to authenticate with
-     * @return true if the given password matches the password for this user
-     */
-    public boolean authenticate(String password) {
-
-        System.setProperty("jcifs.smb.client.disablePlainTextPasswords",
-                            "true" );
-        try {
-            UniAddress mydomaincontroller = UniAddress.getByName(
-                                                getDomainController());
-            NtlmPasswordAuthentication mycreds = new
-                                NtlmPasswordAuthentication(
-                                        getDomainName(),
-                                        super.getId(),
-                                        password);
-            SmbSession.logon( mydomaincontroller, mycreds );
-            // SUCCESS
-            return true;
-        } catch( final SmbAuthException sae ) {
-            // AUTHENTICATION FAILURE
-            if (log.isInfoEnabled()) {
-                log.info("Authentication against [" + getDomainController() +"]" +
-                         " failed for " + getDomainName() + "/" +  super.getId());
-            }
-            return false;
-        } catch(final SmbException se ) {
-            // NETWORK PROBLEMS?
-			return false;
-        } catch(final  UnknownHostException unho) {
-            return false;
-        }
-
-    }
-
-    /**
-     * Read the properties
-     * @throws IOException if the properties cannot be found.
-     */
-    private void readProperties(File configurationDirectory) throws IOException {
-        // create and load default properties
-        File propertiesFile = new File(configurationDirectory, "cifs.properties");
-
-        if (defaultProperties == null) {
-            defaultProperties = new Properties();
-
-            FileInputStream in = null;
-            try {
-                in = new FileInputStream(propertiesFile);
-                defaultProperties.load(in);
-            } finally {
-                if (in != null) {
-                    in.close();
-                }
+   public CIFSUser(File configurationDirectory, String id, String fullName, String email, String password) {
+      super(configurationDirectory, id, fullName, email, password);
+   }
+   /**
+    * Initializes this user.
+    * 
+    * @throws ConfigurationException
+    *            when something went wrong.
+    */
+   protected void initialize() throws ConfigurationException {
+      try{
+         readProperties(super.getConfigurationDirectory());
+      }catch(final IOException ioe){
+         throw new ConfigurationException("Reading cifs.properties file in [" + super.getConfigurationDirectory() + "] failed", ioe);
+      }
+   }
+   /**
+    * Create a new CIFSUser from a configuration
+    * 
+    * @param config
+    *           the <code>Configuration</code> specifying the user details
+    * @throws ConfigurationException
+    *            if the user could not be instantiated
+    */
+   public void configure(Configuration config) throws ConfigurationException {
+      super.configure(config);
+      initialize();
+   }
+   /**
+    * Authenticate a user. This is done by NTDomain Authentication using jcifs
+    * 
+    * @param password
+    *           to authenticate with
+    * @return true if the given password matches the password for this user
+    */
+   public boolean authenticate(String password) {
+      System.setProperty("jcifs.smb.client.disablePlainTextPasswords", "true");
+      try{
+         UniAddress mydomaincontroller = UniAddress.getByName(getDomainController());
+         NtlmPasswordAuthentication mycreds = new NtlmPasswordAuthentication(getDomainName(), super.getId(), password);
+         SmbSession.logon(mydomaincontroller, mycreds);
+         // SUCCESS
+         return true;
+      }catch(final SmbAuthException sae){
+         // AUTHENTICATION FAILURE
+         if(log.isInfoEnabled()){
+            log.info("Authentication against [" + getDomainController() + "]" + " failed for " + getDomainName() + "/" + super.getId());
+         }
+         return false;
+      }catch(final SmbException se){
+         // NETWORK PROBLEMS?
+         return false;
+      }catch(final UnknownHostException unho){
+         return false;
+      }
+   }
+   /**
+    * Read the properties
+    * 
+    * @throws IOException
+    *            if the properties cannot be found.
+    */
+   private void readProperties(File configurationDirectory) throws IOException {
+      // create and load default properties
+      File propertiesFile = new File(configurationDirectory, "cifs.properties");
+      if(defaultProperties == null){
+         defaultProperties = new Properties();
+         FileInputStream in = null;
+         try{
+            in = new FileInputStream(propertiesFile);
+            defaultProperties.load(in);
+         }finally{
+            if(in != null){
+               in.close();
             }
-
-        }
-    }
-
-    /**
-     * Get the domain controller we want to authenticate against
-     * @return the name of the domain controller
-     */
-     private String getDomainController() {
-         return (String)defaultProperties.get(DOMAIN_CONTROLLER);
-     }
-
-    /**
-     * Get the domain name
-     * @return the domain name
-     */
-     private String getDomainName() {
-         return (String)defaultProperties.get(DOMAIN);
-     }
-
+         }
+      }
+   }
+   /**
+    * Get the domain controller we want to authenticate against
+    * 
+    * @return the name of the domain controller
+    */
+   private String getDomainController() {
+      return (String) defaultProperties.get(DOMAIN_CONTROLLER);
+   }
+   /**
+    * Get the domain name
+    * 
+    * @return the domain name
+    */
+   private String getDomainName() {
+      return (String) defaultProperties.get(DOMAIN);
+   }
 }

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRange.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRange.java?rev=617035&r1=617034&r2=617035&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRange.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/ac/file/FileIPRange.java Wed Jan 30 23:44:03 2008
@@ -14,14 +14,10 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 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;
@@ -31,123 +27,106 @@
 import org.apache.lenya.ac.Machine;
 import org.apache.lenya.ac.impl.AbstractIPRange;
 import org.apache.lenya.ac.impl.ItemConfiguration;
-
 /**
  * IP range that is stored in a file.
  */
 public class FileIPRange extends AbstractIPRange implements Serializable {
-
-	/**
-	 * Main method.
-	 * 
-	 * @param args
-	 *            The command-line arguments.
-	 * @deprecated This should bemoved to a JUnit test.
-	 */
-	public static void main(String[] args) {
-		if (args.length == 0) {
-			System.out.println(
-				"Usage: network, netmask, ip (e.g. 192.168.0.64 255.255.255.240 192.168.0.70)");
-			return;
-		}
-		IPRange ipr = new FileIPRange();
-		try {
-			ipr.setNetworkAddress(args[0]);
-			ipr.setSubnetMask(args[1]);
-			if (ipr.contains(new Machine(args[2]))) {
-				System.out.println("true");
-			} else {
-				System.out.println("false");
-			}
-		} catch (Exception e) {
-			System.err.println(e);
-		}
-	}
-
-	/**
-	 * Ctor.
-	 */
-	public FileIPRange() {
-	}
-
-	/**
-	 * Ctor.
-	 * 
-	 * @param configurationDirectory
-	 *            The configuration directory.
-	 * @param id
-	 *            The IP range ID.
-	 */
-	public FileIPRange(File configurationDirectory, String id) {
-		super(id);
-		setConfigurationDirectory(configurationDirectory);
-	}
-
-	/**
-	 * @see org.apache.lenya.ac.impl.AbstractIPRange#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);
-		}
-	}
-
-	/**
-	 * Returns the configuration file.
-	 * 
-	 * @return A file object.
-	 */
-	protected File getFile() {
-		File xmlPath = getConfigurationDirectory();
-		File xmlFile = new File(xmlPath, getId() + FileIPRangeManager.SUFFIX);
-		return xmlFile;
-	}
-
-	/**
-	 * @see org.apache.lenya.ac.Item#configure(org.apache.avalon.framework.configuration.Configuration)
-	 */
-	public void configure(Configuration config) throws ConfigurationException {
-		new ItemConfiguration().configure(this, config);
-
-		String networkAddress = config.getChild(ELEMENT_NETWORK_ADDRESS).getValue();
-		String subnetMask = config.getChild(ELEMENT_SUBNET_MASK).getValue();
-
-		try {
-			setNetworkAddress(networkAddress);
-			setSubnetMask(subnetMask);
-		} catch (AccessControlException e) {
-			throw new ConfigurationException("Configuring IP range [" + getId() + "] failed: ", e);
-		}
-
-	}
-
-	public static final String IP_RANGE = "ip-range";
-	public static final String ELEMENT_NETWORK_ADDRESS = "network-address";
-	public static final String ELEMENT_SUBNET_MASK = "subnet-mask";
-
-	/**
-	 * 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(IP_RANGE);
-		new ItemConfiguration().save(this, config);
-
-		DefaultConfiguration networkAddressConfig =
-			new DefaultConfiguration(ELEMENT_NETWORK_ADDRESS);
-		networkAddressConfig.setValue(getNetworkAddress().getHostAddress());
-		config.addChild(networkAddressConfig);
-
-		DefaultConfiguration subnetMaskConfig = new DefaultConfiguration(ELEMENT_SUBNET_MASK);
-		subnetMaskConfig.setValue(getSubnetMask().getHostAddress());
-		config.addChild(subnetMaskConfig);
-
-		return config;
-	}
+   private static final long serialVersionUID = 1L;
+   /**
+    * Main method.
+    * 
+    * @param args
+    *           The command-line arguments.
+    * @deprecated This should bemoved to a JUnit test.
+    */
+   public static void main(String[] args) {
+      if(args.length == 0){
+         System.out.println("Usage: network, netmask, ip (e.g. 192.168.0.64 255.255.255.240 192.168.0.70)");
+         return;
+      }
+      IPRange ipr = new FileIPRange();
+      try{
+         ipr.setNetworkAddress(args[0]);
+         ipr.setSubnetMask(args[1]);
+         if(ipr.contains(new Machine(args[2]))){
+            System.out.println("true");
+         }else{
+            System.out.println("false");
+         }
+      }catch(Exception e){
+         System.err.println(e);
+      }
+   }
+   /**
+    * Ctor.
+    */
+   public FileIPRange() {
+   }
+   /**
+    * Ctor.
+    * 
+    * @param configurationDirectory
+    *           The configuration directory.
+    * @param id
+    *           The IP range ID.
+    */
+   public FileIPRange(File configurationDirectory, String id) {
+      super(id);
+      setConfigurationDirectory(configurationDirectory);
+   }
+   /**
+    * @see org.apache.lenya.ac.impl.AbstractIPRange#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);
+      }
+   }
+   /**
+    * Returns the configuration file.
+    * 
+    * @return A file object.
+    */
+   protected File getFile() {
+      File xmlPath = getConfigurationDirectory();
+      File xmlFile = new File(xmlPath, getId() + FileIPRangeManager.SUFFIX);
+      return xmlFile;
+   }
+   /**
+    * @see org.apache.lenya.ac.Item#configure(org.apache.avalon.framework.configuration.Configuration)
+    */
+   public void configure(Configuration config) throws ConfigurationException {
+      new ItemConfiguration().configure(this, config);
+      String networkAddress = config.getChild(ELEMENT_NETWORK_ADDRESS).getValue();
+      String subnetMask = config.getChild(ELEMENT_SUBNET_MASK).getValue();
+      try{
+         setNetworkAddress(networkAddress);
+         setSubnetMask(subnetMask);
+      }catch(AccessControlException e){
+         throw new ConfigurationException("Configuring IP range [" + getId() + "] failed: ", e);
+      }
+   }
+   public static final String IP_RANGE = "ip-range";
+   public static final String ELEMENT_NETWORK_ADDRESS = "network-address";
+   public static final String ELEMENT_SUBNET_MASK = "subnet-mask";
+   /**
+    * 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(IP_RANGE);
+      new ItemConfiguration().save(this, config);
+      DefaultConfiguration networkAddressConfig = new DefaultConfiguration(ELEMENT_NETWORK_ADDRESS);
+      networkAddressConfig.setValue(getNetworkAddress().getHostAddress());
+      config.addChild(networkAddressConfig);
+      DefaultConfiguration subnetMaskConfig = new DefaultConfiguration(ELEMENT_SUBNET_MASK);
+      subnetMaskConfig.setValue(getSubnetMask().getHostAddress());
+      config.addChild(subnetMaskConfig);
+      return config;
+   }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.