incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: incubator-ftpserver/src/java/org/apache/ftpserver/iprestrictor FileIpRestrictor.java
Date Thu, 06 Oct 2005 06:10:22 GMT
rana_b      2005/10/05 23:10:22

  Modified:    src/java/org/apache/ftpserver/iprestrictor
                        FileIpRestrictor.java
  Log:
  commons-logging used
  
  Revision  Changes    Path
  1.2       +10 -9     incubator-ftpserver/src/java/org/apache/ftpserver/iprestrictor/FileIpRestrictor.java
  
  Index: FileIpRestrictor.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/iprestrictor/FileIpRestrictor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileIpRestrictor.java	7 Sep 2005 05:03:37 -0000	1.1
  +++ FileIpRestrictor.java	6 Oct 2005 06:10:22 -0000	1.2
  @@ -24,9 +24,10 @@
   import java.net.InetAddress;
   import java.util.ArrayList;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   import org.apache.ftpserver.ftplet.Configuration;
   import org.apache.ftpserver.ftplet.FtpException;
  -import org.apache.ftpserver.ftplet.Logger;
   import org.apache.ftpserver.interfaces.IIpRestrictor;
   import org.apache.ftpserver.util.IoUtils;
   import org.apache.ftpserver.util.RegularExpr;
  @@ -41,16 +42,16 @@
   
       private final static String LINE_SEP = System.getProperty("line.separator", "\n");
       
  +    private Log m_log;
       private String m_file;
       private Object[][] m_permissions;
  -    private Logger m_logger;
       
       
       /**
  -     * Set logger.
  +     * Set the log factory.
        */
  -    public void setLogger(Logger logger) {
  -        m_logger = logger;
  +    public void setLogFactory(LogFactory factory) {
  +        m_log = factory.getInstance(getClass());
       }
       
       /**
  @@ -61,7 +62,7 @@
           File dir = new File(m_file).getParentFile();
           if( (!dir.exists()) && (!dir.mkdirs()) ) {
               String dirName = dir.getAbsolutePath();
  -            m_logger.error("Cannot create directory - " + dirName);
  +            m_log.fatal("Cannot create directory - " + dirName);
               throw new FtpException("Cannot create directory : " + dirName);
           }
           
  @@ -114,7 +115,7 @@
                   }
               }
               catch(IOException ex) {
  -                m_logger.error("FileIpRestrictor.getPermissions()", ex);
  +                m_log.error("FileIpRestrictor.getPermissions()", ex);
                   throw new FtpException("FileIpRestrictor.getPermissions()", ex);
               }
               finally {
  @@ -146,7 +147,7 @@
               m_permissions = permissions;
           }
           catch(IOException ex) {
  -            m_logger.error("FileIpRestrictor.setPermissions()", ex);
  +            m_log.error("FileIpRestrictor.setPermissions()", ex);
               throw new FtpException("FileIpRestrictor.setPermissions()", ex);
           }
           finally {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message