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/message MessageResourceImpl.java
Date Thu, 06 Oct 2005 06:10:48 GMT
rana_b      2005/10/05 23:10:48

  Modified:    src/java/org/apache/ftpserver/message
                        MessageResourceImpl.java
  Log:
  commons-logging used
  
  Revision  Changes    Path
  1.3       +11 -9     incubator-ftpserver/src/java/org/apache/ftpserver/message/MessageResourceImpl.java
  
  Index: MessageResourceImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-ftpserver/src/java/org/apache/ftpserver/message/MessageResourceImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MessageResourceImpl.java	22 Sep 2005 05:34:47 -0000	1.2
  +++ MessageResourceImpl.java	6 Oct 2005 06:10:48 -0000	1.3
  @@ -27,9 +27,10 @@
   import java.util.Properties;
   import java.util.StringTokenizer;
   
  +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.IMessageResource;
   import org.apache.ftpserver.util.IoUtils;
   
  @@ -48,10 +49,11 @@
   
       private final static String RESOURCE_PATH = "org/apache/ftpserver/message/";
       
  +    private Log m_log;
  +    
       private String[] m_languages;
       private HashMap m_messages;
       private String m_customMessageDir;
  -    private Logger m_logger;
       
       private static class PropertiesPair {
           public Properties m_default = new Properties();
  @@ -60,10 +62,10 @@
       
       
       /**
  -     * Set logger.
  +     * Set the log factory.
        */
  -    public void setLogger(Logger logger) {
  -        m_logger = logger;
  +    public void setLogFactory(LogFactory factory) {
  +        m_log = factory.getInstance(getClass());
       }
       
       /**
  @@ -121,7 +123,7 @@
               }
           }
           catch(Exception ex) {
  -            m_logger.warn("MessageResourceImpl.createPropertiesPair()", ex);
  +            m_log.warn("MessageResourceImpl.createPropertiesPair()", ex);
               throw new FtpException("MessageResourceImpl.createPropertiesPair()", ex);
           }
           finally {
  @@ -144,7 +146,7 @@
               }
           }
           catch(Exception ex) {
  -            m_logger.warn("MessageResourceImpl.createPropertiesPair()", ex);
  +            m_log.warn("MessageResourceImpl.createPropertiesPair()", ex);
               throw new FtpException("MessageResourceImpl.createPropertiesPair()", ex);
           }
           finally {
  @@ -256,7 +258,7 @@
               prop.store(out, "Custom Messages");
           }
           catch(IOException ex) {
  -            m_logger.error("MessageResourceImpl.save()", ex);
  +            m_log.error("MessageResourceImpl.save()", ex);
               throw new FtpException("MessageResourceImpl.save()", 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