You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ba...@apache.org on 2005/12/29 19:34:09 UTC

svn commit: r359868 - in /james/server/trunk/src/java/org/apache/james: core/ services/ transport/mailets/ userrepository/ util/io/ util/mordred/

Author: bago
Date: Thu Dec 29 10:33:59 2005
New Revision: 359868

URL: http://svn.apache.org/viewcvs?rev=359868&view=rev
Log:
Removed code deprecated in James 1.x and unused code. Cleaned some imports/unused variable, copyright years in touched files.

Modified:
    james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java
    james/server/trunk/src/java/org/apache/james/services/UsersRepository.java
    james/server/trunk/src/java/org/apache/james/transport/mailets/AbstractRedirect.java
    james/server/trunk/src/java/org/apache/james/userrepository/AbstractUsersRepository.java
    james/server/trunk/src/java/org/apache/james/userrepository/UsersFileRepository.java
    james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java
    james/server/trunk/src/java/org/apache/james/util/io/IOUtil.java
    james/server/trunk/src/java/org/apache/james/util/mordred/JdbcDataSource.java

Modified: james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java?rev=359868&r1=359867&r2=359868&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java (original)
+++ james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java Thu Dec 29 10:33:59 2005
@@ -52,10 +52,6 @@
         users.addUser(name,attributes);
     }
 
-    public Object getAttributes(String name) {
-        return users.getAttributes(name);
-    }
-
     public User getUserByName(String name) {
         return users.getUserByName(name);
     }
@@ -82,10 +78,6 @@
 
     public boolean containsCaseInsensitive(String name) {
         return users.containsCaseInsensitive(name);
-    }
-
-    public boolean test(String name, Object attributes) {
-        return users.test(name,attributes);
     }
 
     public boolean test(String name, String password) {

Modified: james/server/trunk/src/java/org/apache/james/services/UsersRepository.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/services/UsersRepository.java?rev=359868&r1=359867&r2=359868&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/services/UsersRepository.java (original)
+++ james/server/trunk/src/java/org/apache/james/services/UsersRepository.java Thu Dec 29 10:33:59 2005
@@ -1,5 +1,5 @@
 /***********************************************************************
- * Copyright (c) 2000-2004 The Apache Software Foundation.             *
+ * Copyright (c) 2000-2005 The Apache Software Foundation.             *
  * All rights reserved.                                                *
  * ------------------------------------------------------------------- *
  * Licensed under the Apache License, Version 2.0 (the "License"); you *
@@ -56,14 +56,6 @@
     void addUser(String name, Object attributes);
 
     /**
-     * Gets the attribute for a user.  Not clear on behavior.
-     *
-     * @deprecated As of James 1.2.2 . Use the {@link #getUserByName(String) getUserByName} method.
-     */
-    Object getAttributes(String name);
-
-
-    /**
      * Get the user object with the specified user name.  Return null if no
      * such user.
      *
@@ -125,16 +117,6 @@
      * @return whether the user is in the repository
      */
     boolean containsCaseInsensitive(String name);
-
-
-    /**
-     * Tests a user with the appropriate attributes.  In current implementations,
-     * this typically means "check the password" where a String password is passed
-     * as the Object attributes.
-     *
-     * @deprecated As of James 1.2.2, use {@link #test(String, String) test(String name, String password)}
-     */
-    boolean test(String name, Object attributes);
 
     /**
      * Test if user with name 'name' has password 'password'.

Modified: james/server/trunk/src/java/org/apache/james/transport/mailets/AbstractRedirect.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/transport/mailets/AbstractRedirect.java?rev=359868&r1=359867&r2=359868&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/transport/mailets/AbstractRedirect.java (original)
+++ james/server/trunk/src/java/org/apache/james/transport/mailets/AbstractRedirect.java Thu Dec 29 10:33:59 2005
@@ -1171,31 +1171,6 @@
     }
 
     /**
-     * Gets the MailAddress corresponding to the existing "Return-Path" of
-     * <I>mail</I>.
-     * If empty returns <CODE>SpecialAddress.NULL</CODE>,
-     * if missing return <CODE>null</CODE>.
-     * @deprecated The Return-Path header is no longer available until local delivery.
-     */
-    protected MailAddress getExistingReturnPath(Mail mail) throws MessagingException {
-        MailAddress mailAddress = null;
-        String[] returnPathHeaders = mail.getMessage().getHeader(RFC2822Headers.RETURN_PATH);
-        String returnPathHeader = null;
-        if (returnPathHeaders != null) {
-            returnPathHeader = returnPathHeaders[0];
-            if (returnPathHeader != null) {
-                returnPathHeader = returnPathHeader.trim();
-                if (returnPathHeader.equals("<>")) {
-                    mailAddress = SpecialAddress.NULL;
-                } else {
-                    mailAddress = new MailAddress(new InternetAddress(returnPathHeader));
-                }
-            }
-        }
-        return mailAddress;
-    }
-
-    /**
      * Utility method for obtaining a string representation of an array of Objects.
      */
     private String arrayToString(Object[] array) {

Modified: james/server/trunk/src/java/org/apache/james/userrepository/AbstractUsersRepository.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/userrepository/AbstractUsersRepository.java?rev=359868&r1=359867&r2=359868&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/userrepository/AbstractUsersRepository.java (original)
+++ james/server/trunk/src/java/org/apache/james/userrepository/AbstractUsersRepository.java Thu Dec 29 10:33:59 2005
@@ -1,5 +1,5 @@
 /***********************************************************************
- * Copyright (c) 2000-2004 The Apache Software Foundation.             *
+ * Copyright (c) 2000-2005 The Apache Software Foundation.             *
  * All rights reserved.                                                *
  * ------------------------------------------------------------------- *
  * Licensed under the Apache License, Version 2.0 (the "License"); you *
@@ -182,15 +182,6 @@
     }
 
     /**
-     * Gets the attribute for a user.  Not clear on behavior.
-     *
-     * @deprecated As of James 1.2.2 . Use the {@link #getUserByName(String) getUserByName} method.
-     */
-    public Object getAttributes(String name) {
-        throw new RuntimeException("Improper use of deprecated method - read javadocs");
-    }
-
-    /**
      * Get the user object with the specified user name.  Return null if no
      * such user.
      *
@@ -251,22 +242,6 @@
     public boolean containsCaseInsensitive(String name) {
         User user = getUserByName( name, true );
         return ( user != null );
-    }
-
-    /**
-     * Tests a user with the appropriate attributes.  In current implementations,
-     * this typically means "check the password" where a String password is passed
-     * as the Object attributes.
-     *
-     * @param name the name of the user to be tested
-     * @param attributes the password to be tested
-     *
-     * @throws UnsupportedOperationException always, as this method should not be used
-     *
-     * @deprecated As of James 1.2.2, use {@link #test(String, String) test(String name, String password)}
-     */
-    public boolean test(String name, Object attributes) {
-        throw new UnsupportedOperationException("Improper use of deprecated method - read javadocs");
     }
 
     /**

Modified: james/server/trunk/src/java/org/apache/james/userrepository/UsersFileRepository.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/userrepository/UsersFileRepository.java?rev=359868&r1=359867&r2=359868&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/userrepository/UsersFileRepository.java (original)
+++ james/server/trunk/src/java/org/apache/james/userrepository/UsersFileRepository.java Thu Dec 29 10:33:59 2005
@@ -1,5 +1,5 @@
 /***********************************************************************
- * Copyright (c) 2000-2004 The Apache Software Foundation.             *
+ * Copyright (c) 2000-2005 The Apache Software Foundation.             *
  * All rights reserved.                                                *
  * ------------------------------------------------------------------- *
  * Licensed under the Apache License, Version 2.0 (the "License"); you *
@@ -20,14 +20,14 @@
 import org.apache.avalon.cornerstone.services.store.ObjectRepository;
 import org.apache.avalon.cornerstone.services.store.Store;
 import org.apache.avalon.framework.activity.Initializable;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
 import org.apache.james.services.User;
 import org.apache.james.services.UsersRepository;
 
@@ -56,9 +56,6 @@
      */
     protected static boolean DEEP_DEBUG = false;
 
-    /** @deprecated what was this for? */
-    private static final String TYPE = "USERS";
-
     private Store store;
     private ObjectRepository or;
 
@@ -203,10 +200,6 @@
         return null;
     }
 
-    public Object getAttributes(String name) {
-        throw new UnsupportedOperationException("Improper use of deprecated method - read javadocs");
-    }
-
     public boolean updateUser(User user) {
         String username = user.getUserName();
         if (!contains(username)) {
@@ -236,16 +229,6 @@
             }
         }
         return false;
-    }
-
-    /**
-     */
-    public boolean test(String name, Object attributes) {
-        try {
-            return attributes.equals(or.get(name));
-        } catch (Exception e) {
-            return false;
-        }
     }
 
     public boolean test(String name, String password) {

Modified: james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java?rev=359868&r1=359867&r2=359868&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java (original)
+++ james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java Thu Dec 29 10:33:59 2005
@@ -25,7 +25,6 @@
 import org.apache.avalon.framework.context.ContextException;
 import org.apache.avalon.framework.context.Contextualizable;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.james.Constants;
@@ -62,14 +61,6 @@
     extends AbstractLogEnabled
     implements UsersRepository, Serviceable, Configurable, Contextualizable, Initializable{
 
-    private ServiceManager comp;
-
-    private Logger logger;
-    private String path;
-    private String name;
-    private String destination;
-    private String type;
-    private String model;
     private DirContext ctx;
 
     private String LDAPHost;
@@ -104,7 +95,7 @@
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager compMgr) {
-        this.comp = compMgr;
+        // this.comp = compMgr;
     }
 
     /**
@@ -238,7 +229,7 @@
     public Iterator list() {
 
         List result = new ArrayList();
-        String filter = mailAddressAttr + "=*";
+        // String filter = mailAddressAttr + "=*";
         String[] attrIDs = {membersAttr};
 
         try {
@@ -292,10 +283,6 @@
         return false;
     }
 
-    public boolean test(String name, String password) {
-        return false;
-    }
-
     /**
      * Adds userName to the MemberAttribute (specified in conf.xml) of this
      * node.
@@ -356,9 +343,9 @@
             addGroupToUser(userName);
         }
 
-        if (managePasswordAttr) {
-            String userPassword = (String) attributes; // Not yet implemented
-        }
+//        if (managePasswordAttr) {
+//            String userPassword = (String) attributes; // Not yet implemented
+//        }
     }
 
     private void addGroupToUser(String userName) {
@@ -431,11 +418,6 @@
         }
     }
 
-    public synchronized Object getAttributes(String name) {
-        return null;
-    }
-
-
     public synchronized void removeUser(String userName) {
         String[] attrIDs = {membersAttr};
 
@@ -605,10 +587,9 @@
     }
 
 
-    public boolean test(String name, Object attributes) {
+    public boolean test(String name, String testPassword) {
         boolean result = false;
         boolean foundFlag = false;
-        String testPassword = (String) attributes;
         String userDN = null;
 
         try {

Modified: james/server/trunk/src/java/org/apache/james/util/io/IOUtil.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/util/io/IOUtil.java?rev=359868&r1=359867&r2=359868&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/util/io/IOUtil.java (original)
+++ james/server/trunk/src/java/org/apache/james/util/io/IOUtil.java Thu Dec 29 10:33:59 2005
@@ -1,5 +1,5 @@
 /* 
- * Copyright 1999-2004 The Apache Software Foundation
+ * Copyright 1999-2005 The Apache Software Foundation
  * Licensed  under the  Apache License,  Version 2.0  (the "License");
  * you may not use  this file  except in  compliance with the License.
  * You may obtain a copy of the License at 
@@ -18,7 +18,6 @@
 package org.apache.james.util.io;
 
 import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -538,27 +537,6 @@
     {
         output.write( input );
     }
-
-    /**
-     * Copy bytes from an <code>InputStream</code> to an
-     * <code>OutputStream</code>, with buffering.
-     * This is equivalent to passing a
-     * {@link java.io.BufferedInputStream} and
-     * {@link java.io.BufferedOutputStream} to {@link #copy(InputStream, OutputStream)},
-     * and flushing the output stream afterwards. The streams are not closed
-     * after the copy.
-     * @deprecated Buffering streams is actively harmful! See the class description as to why. Use
-     * {@link #copy(InputStream, OutputStream)} instead.
-     */
-    public static void bufferedCopy( final InputStream input, final OutputStream output )
-        throws IOException
-    {
-        final BufferedInputStream in = new BufferedInputStream( input );
-        final BufferedOutputStream out = new BufferedOutputStream( output );
-        copy( in, out );
-        out.flush();
-    }
-
 
     ///////////////////////////////////////////////////////////////
     // String -> byte[]

Modified: james/server/trunk/src/java/org/apache/james/util/mordred/JdbcDataSource.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/util/mordred/JdbcDataSource.java?rev=359868&r1=359867&r2=359868&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/util/mordred/JdbcDataSource.java (original)
+++ james/server/trunk/src/java/org/apache/james/util/mordred/JdbcDataSource.java Thu Dec 29 10:33:59 2005
@@ -17,14 +17,6 @@
 
 package org.apache.james.util.mordred;
 
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import java.util.ArrayList;
-
 import org.apache.avalon.excalibur.datasource.DataSourceComponent;
 import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.configuration.Configurable;
@@ -32,6 +24,12 @@
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.ArrayList;
+
 
 /**
  * <p>
@@ -301,18 +299,6 @@
         }
         // The various entries will finalize themselves once the reference
         // is removed, so no need to do it here
-    }
-
-    /**
-     * Close all connections.  The connection pooler will recreate these connections if something
-     * starts requesting them again.
-     *
-     * @deprecated This was left over code from Town... but not exposed in Avalon.
-     */
-    public void killAllConnections() {
-        //Just remove the references to all the connections... this will cause them to get
-        // finalized before very long. (not an instant shutdown, but that's ok).
-        synchronized (pool) { pool.clear(); }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org