avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon/proposal/4.0/src/java/org/apache/aut/security AbstractPolicy.java
Date Thu, 15 Mar 2001 03:09:31 GMT
donaldp     01/03/14 19:09:30

  Modified:    proposal/4.0/src/java/org/apache/aut/io FileUtil.java
               proposal/4.0/src/java/org/apache/aut/security
                        AbstractPolicy.java
  Added:       proposal/4.0/src/java/org/apache/aut StringUtil.java
  Log:
  Made aut no longer depend on Avalon
  
  Revision  Changes    Path
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/aut/StringUtil.java
  
  Index: StringUtil.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.aut;
  
  /**
   * This class provides basic facilities for manipulating strings.
   * 
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  public final class StringUtil
  {
      /**
       * Private constructor to prevent instantiation.
       */
      private StringUtil()
      {
      }
      
      /**
       * Replace substrings of one string with another string and return altered string.
       *
       * @param original input string
       * @param oldString the substring section to replace
       * @param newString the new substring replacing old substring section
       * @return converted string
       */
      public static String replaceSubString( final String original,
                                             final String oldString,
                                             final String newString )
      {
          final StringBuffer sb = new StringBuffer();
          
          int end = original.indexOf( oldString );
          int start = 0;
          final int stringSize = oldString.length();
          
          while( end != -1 )
          {
              sb.append( original.substring( start, end ) );
              sb.append( newString );
              start = end + stringSize;
              end = original.indexOf( oldString, start );
          }
          
          end = original.length();
          sb.append( original.substring( start, end ) );
          
          return sb.toString();
      }
  }
  
  
  
  1.2       +1 -1      jakarta-avalon/proposal/4.0/src/java/org/apache/aut/io/FileUtil.java
  
  Index: FileUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/aut/io/FileUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileUtil.java	2001/02/26 00:39:56	1.1
  +++ FileUtil.java	2001/03/15 03:09:29	1.2
  @@ -9,7 +9,7 @@
   
   import java.io.*;
   import java.net.URL;
  -import org.apache.avalon.util.StringUtil;
  +import org.apache.aut.StringUtil;
   
   /**
    * This class provides basic facilities for manipulating files.
  
  
  
  1.2       +2 -2      jakarta-avalon/proposal/4.0/src/java/org/apache/aut/security/AbstractPolicy.java
  
  Index: AbstractPolicy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/aut/security/AbstractPolicy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractPolicy.java	2001/02/26 00:40:08	1.1
  +++ AbstractPolicy.java	2001/03/15 03:09:30	1.2
  @@ -23,8 +23,8 @@
   import java.util.Enumeration;
   import java.util.PropertyPermission;
   import org.apache.aut.io.FileUtil;
  -import org.apache.avalon.Loggable;
   import org.apache.avalon.component.Component;
  +import org.apache.avalon.logger.Loggable;
   import org.apache.log.Logger;
   
   /**
  @@ -36,7 +36,7 @@
       extends Policy
       implements Component, Loggable
   {
  -    protected final static boolean     DEBUG         = true;
  +    protected final static boolean   DEBUG         = true;
   
       protected final ArrayList        m_entries     = new ArrayList();
       
  
  
  

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


Mime
View raw message