directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1062251 [6/13] - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-api/src/main/java/org/apache/director...
Date Sat, 22 Jan 2011 20:08:59 GMT
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java Sat Jan 22 20:08:48 2011
@@ -33,7 +33,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.UTFUtils;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
@@ -500,7 +499,7 @@ public class DefaultEntryAttribute imple
                 // Try to convert the value from a byte[] to a String
                 if ( value != null )
                 {
-                    String valueStr = StringTools.utf8ToString( (byte[])value.getReference() );
+                    String valueStr = Strings.utf8ToString((byte[]) value.getReference());
                 
                     return valueStr;
                 }
@@ -555,7 +554,7 @@ public class DefaultEntryAttribute imple
      */
     public void setId( String id )
     {
-        String newId = StringTools.trim( StringTools.lowerCaseAscii( id ) );
+        String newId = Strings.trim(Strings.lowerCaseAscii(id));
 
         if ( newId.length() == 0 )
         {
@@ -699,14 +698,14 @@ public class DefaultEntryAttribute imple
      */
     public void setUpId( String upId, AttributeType attributeType )
     {
-        String trimmed = StringTools.trim( upId );
+        String trimmed = Strings.trim(upId);
 
-        if ( StringTools.isEmpty( trimmed ) && ( attributeType == null ) )
+        if ( Strings.isEmpty(trimmed) && ( attributeType == null ) )
         {
             throw new IllegalArgumentException( "Cannot set a null ID with a null AttributeType" );
         }
         
-        String id = StringTools.toLowerCase( trimmed );
+        String id = Strings.toLowerCase(trimmed);
         
         if ( attributeType == null )
         {
@@ -739,11 +738,11 @@ public class DefaultEntryAttribute imple
             }
         }
         
-        if ( StringTools.isEmpty( id ) )
+        if ( Strings.isEmpty(id) )
         {
             this.attributeType = attributeType;
             this.upId = attributeType.getName();
-            this.id = StringTools.trim( this.upId );
+            this.id = Strings.trim(this.upId);
             
             // Compute the hashCode
             rehash();
@@ -1154,7 +1153,7 @@ public class DefaultEntryAttribute imple
                     
                     if ( val != null )
                     {
-                        valBytes = StringTools.getBytesUtf8( val );
+                        valBytes = Strings.getBytesUtf8(val);
                     }
                     
                     Value<byte[]> value = createBinaryValue( attributeType, valBytes );
@@ -1209,7 +1208,7 @@ public class DefaultEntryAttribute imple
                     
                     if ( val != null )
                     {
-                        valBytes = StringTools.getBytesUtf8( val );
+                        valBytes = Strings.getBytesUtf8(val);
                     }
                     
                     Value<byte[]> value = createBinaryValue( attributeType, valBytes );
@@ -1370,7 +1369,7 @@ public class DefaultEntryAttribute imple
                         byte[] binaryVal = val.getBytes();
                         
                         // We have to convert the binary value to a String
-                        if ( ! values.contains( new StringValue( StringTools.utf8ToString( binaryVal ) ) ) )
+                        if ( ! values.contains( new StringValue( Strings.utf8ToString(binaryVal) ) ) )
                         {
                             return false;
                         }
@@ -1396,7 +1395,7 @@ public class DefaultEntryAttribute imple
                         String stringVal = val.getString();
                         
                         // We have to convert the binary value to a String
-                        if ( ! values.contains( new BinaryValue( StringTools.getBytesUtf8( stringVal ) ) ) )
+                        if ( ! values.contains( new BinaryValue( Strings.getBytesUtf8(stringVal) ) ) )
                         {
                             return false;
                         }
@@ -1498,7 +1497,7 @@ public class DefaultEntryAttribute imple
                 // don't find one in the values
                 for ( String val:vals )
                 {
-                    byte[] binaryVal = StringTools.getBytesUtf8( val );
+                    byte[] binaryVal = Strings.getBytesUtf8(val);
     
                     if ( !contains( new BinaryValue( binaryVal ) ) )
                     {
@@ -1576,7 +1575,7 @@ public class DefaultEntryAttribute imple
                 // don't find one in the values
                 for ( byte[] val:vals )
                 {
-                    String stringVal = StringTools.utf8ToString( val );
+                    String stringVal = Strings.utf8ToString(val);
     
                     if ( !contains( new StringValue( stringVal ) ) )
                     {
@@ -1815,7 +1814,7 @@ public class DefaultEntryAttribute imple
                     {
                         // Convert the binary value to a string value
                         byte[] binaryVal = val.getBytes();
-                        removed &= values.remove( new StringValue( StringTools.utf8ToString( binaryVal ) ) );
+                        removed &= values.remove( new StringValue( Strings.utf8ToString(binaryVal) ) );
                     }
                 }
             }
@@ -1922,7 +1921,7 @@ public class DefaultEntryAttribute imple
                 // to String before removing them
                 for ( byte[] val:vals )
                 {
-                    StringValue value = new StringValue( StringTools.utf8ToString( val ) );
+                    StringValue value = new StringValue( Strings.utf8ToString(val) );
                     removed &= values.remove( value );
                 }
             }
@@ -1987,7 +1986,7 @@ public class DefaultEntryAttribute imple
                 // to byte[] before removing them
                 for ( String val:vals )
                 {
-                    BinaryValue value = new BinaryValue( StringTools.getBytesUtf8( val ) );
+                    BinaryValue value = new BinaryValue( Strings.getBytesUtf8(val) );
                     removed &= values.remove( value );
                 }
             }
@@ -2169,14 +2168,14 @@ public class DefaultEntryAttribute imple
      */
     public boolean instanceOf( String attributeId ) throws LdapInvalidAttributeValueException
     {
-        String trimmedId = StringTools.trim( attributeId );
+        String trimmedId = Strings.trim(attributeId);
         
-        if ( StringTools.isEmpty( trimmedId ) )
+        if ( Strings.isEmpty(trimmedId) )
         {
             return false;
         }
         
-        String normId = StringTools.lowerCaseAscii( trimmedId );
+        String normId = Strings.lowerCaseAscii(trimmedId);
         
         for ( String name:attributeType.getNames() )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java Sat Jan 22 20:08:48 2011
@@ -29,8 +29,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.Normalizer;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.UTFUtils;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -464,7 +464,7 @@ public class StringValue extends Abstrac
      */
     public byte[] getBytes()
     {
-        return StringTools.getBytesUtf8( wrappedValue );
+        return Strings.getBytesUtf8(wrappedValue);
     }
     
     

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java Sat Jan 22 20:08:48 2011
@@ -29,9 +29,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
-import org.apache.directory.shared.ldap.util.Position;
-import org.apache.directory.shared.ldap.util.StringTools;
-import org.apache.directory.shared.util.Strings;
+import org.apache.directory.shared.util.*;
 
 
 /**
@@ -94,12 +92,12 @@ public class FilterParser
             }
 
             // Do we have a MatchingRule ?
-            if ( StringTools.charAt( filter, pos.start ) == ':' )
+            if ( Strings.charAt(filter, pos.start) == ':' )
             {
                 pos.start++;
                 int start = pos.start;
 
-                if ( StringTools.charAt( filter, pos.start ) == '=' )
+                if ( Strings.charAt(filter, pos.start) == '=' )
                 {
                     pos.start++;
 
@@ -151,12 +149,12 @@ public class FilterParser
             }
 
             // Do we have a MatchingRule ?
-            if ( StringTools.charAt( filter, pos.start ) == ':' )
+            if ( Strings.charAt(filter, pos.start) == ':' )
             {
                 pos.start++;
                 int start = pos.start;
 
-                if ( StringTools.charAt( filter, pos.start ) == '=' )
+                if ( Strings.charAt(filter, pos.start) == '=' )
                 {
                     if ( oidRequested )
                     {
@@ -234,7 +232,7 @@ public class FilterParser
      */
     private static Value<?> parseAssertionValue( String filter, Position pos ) throws ParseException
     {
-        char c = StringTools.charAt( filter, pos.start );
+        char c = Strings.charAt(filter, pos.start);
         
         // Create a buffer big enough to contain the value once converted
         byte[] value = new byte[ filter.length() - pos.start];
@@ -242,7 +240,7 @@ public class FilterParser
 
         do
         {
-            if ( StringTools.isUnicodeSubset( c ) )
+            if ( Unicode.isUnicodeSubset(c) )
             {
                 value[current++] = (byte)c;
                 pos.start++;
@@ -253,7 +251,7 @@ public class FilterParser
                 pos.start++;
 
                 // First hex
-                if ( StringTools.isHex( filter, pos.start ) )
+                if ( Chars.isHex(filter, pos.start) )
                 {
                     pos.start++;
                 }
@@ -263,9 +261,9 @@ public class FilterParser
                 }
 
                 // second hex
-                if ( StringTools.isHex( filter, pos.start ) )
+                if ( Chars.isHex(filter, pos.start) )
                 {
-                    value[current++] = StringTools.getHexValue( filter.charAt( pos.start - 1 ), filter.charAt( pos.start ) );
+                    value[current++] = Hex.getHexValue(filter.charAt(pos.start - 1), filter.charAt(pos.start));
                     pos.start++;
                 }
                 else
@@ -279,7 +277,7 @@ public class FilterParser
                 break;
             }
         }
-        while ( ( c = StringTools.charAt( filter, pos.start ) ) != '\0' );
+        while ( ( c = Strings.charAt(filter, pos.start) ) != '\0' );
 
         if ( current != 0 )
         {
@@ -530,7 +528,7 @@ public class FilterParser
             attribute = AttributeUtils.parseAttribute( filter, pos, true );
             
             // Now, we may have a present, substring, simple or an extensible
-            c = StringTools.charAt( filter, pos.start );
+            c = Strings.charAt(filter, pos.start);
 
             switch ( c )
             {
@@ -731,7 +729,7 @@ public class FilterParser
             throw new ParseException( I18n.err( I18n.ERR_04154 ), pos.start );
         }
 
-        char c = StringTools.charAt( filter, pos.start );
+        char c = Strings.charAt(filter, pos.start);
 
         switch ( c )
         {
@@ -771,7 +769,7 @@ public class FilterParser
      * Pasre the grammar rule :
      * filter ::= '(' filterComp ')'
      */
-    private static ExprNode parseFilterInternal( SchemaManager schemaManager, String filter, Position pos ) 
+    private static ExprNode parseFilterInternal( SchemaManager schemaManager, String filter, Position pos )
         throws ParseException, LdapException
     {
         // Check for the left '('
@@ -825,7 +823,7 @@ public class FilterParser
     public static ExprNode parse( SchemaManager schemaManager, String filter ) throws ParseException
     {
         // The filter must not be null. This is a defensive test
-        if ( StringTools.isEmpty( filter ) )
+        if ( Strings.isEmpty(filter) )
         {
             throw new ParseException( I18n.err( I18n.ERR_04158 ), 0 );
         }
@@ -852,7 +850,7 @@ public class FilterParser
     public static ExprNode parse( SchemaManager schemaManager, String filter, Position pos ) throws ParseException
     {
         // The filter must not be null. This is a defensive test
-        if ( StringTools.isEmpty( filter ) )
+        if ( Strings.isEmpty(filter) )
         {
             throw new ParseException( I18n.err( I18n.ERR_04158 ), 0 );
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifAttributesReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifAttributesReader.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifAttributesReader.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifAttributesReader.java Sat Jan 22 20:08:48 2011
@@ -36,7 +36,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -446,7 +446,7 @@ public class LdifAttributesReader extend
 
         LOG.debug( "Starts parsing ldif buffer" );
 
-        if ( StringTools.isEmpty( ldif ) )
+        if ( Strings.isEmpty(ldif) )
         {
             return new BasicAttributes( true );
         }
@@ -509,7 +509,7 @@ public class LdifAttributesReader extend
 
         LOG.debug( "Starts parsing ldif buffer" );
 
-        if ( StringTools.isEmpty( ldif ) )
+        if ( Strings.isEmpty(ldif) )
         {
             return new DefaultEntry();
         }
@@ -574,7 +574,7 @@ public class LdifAttributesReader extend
 
         LOG.debug( "Starts parsing ldif buffer" );
 
-        if ( StringTools.isEmpty( ldif ) )
+        if ( Strings.isEmpty(ldif) )
         {
             return new DefaultEntry();
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java Sat Jan 22 20:08:48 2011
@@ -53,8 +53,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.DnParser;
 import org.apache.directory.shared.ldap.name.RDN;
-import org.apache.directory.shared.ldap.util.Base64;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Base64;
+import org.apache.directory.shared.util.Chars;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -399,7 +400,7 @@ public class LdifReader implements Itera
     // <fill> ::= ' ' <fill> | e
     private void parseFill( char[] document )
     {
-        while ( StringTools.isCharASCII( document, position, ' ' ) )
+        while ( Chars.isCharASCII(document, position, ' ') )
         {
             position++;
         }
@@ -423,7 +424,7 @@ public class LdifReader implements Itera
 
         while ( true )
         {
-            if ( StringTools.isDigit( document, position ) )
+            if ( Chars.isDigit(document, position) )
             {
                 position++;
             }
@@ -454,7 +455,7 @@ public class LdifReader implements Itera
     {
         ChangeType operation = ChangeType.Add;
 
-        String modOp = StringTools.trim( line.substring( "changetype:".length() + 1 ) );
+        String modOp = Strings.trim(line.substring("changetype:".length() + 1));
 
         if ( "add".equalsIgnoreCase( modOp ) )
         {
@@ -571,13 +572,13 @@ public class LdifReader implements Itera
 
             if ( c == ':' )
             {
-                String value = StringTools.trim( line.substring( pos + 2 ) );
+                String value = Strings.trim(line.substring(pos + 2));
 
                 return Base64.decode( value.toCharArray() );
             }
             else
             {
-                return StringTools.trim( line.substring( pos + 1 ) );
+                return Strings.trim(line.substring(pos + 1));
             }
         }
         else
@@ -603,13 +604,13 @@ public class LdifReader implements Itera
 
             if ( c == ':' )
             {
-                String value = StringTools.trim( line.substring( pos + 2 ) );
+                String value = Strings.trim(line.substring(pos + 2));
 
-                return Base64.decode( value.toCharArray() );
+                return Base64.decode(value.toCharArray());
             }
             else if ( c == '<' )
             {
-                String urlName = StringTools.trim( line.substring( pos + 2 ) );
+                String urlName = Strings.trim(line.substring(pos + 2));
 
                 try
                 {
@@ -691,7 +692,7 @@ public class LdifReader implements Itera
             }
             else
             {
-                return StringTools.trim( line.substring( pos + 1 ) );
+                return Strings.trim(line.substring(pos + 1));
             }
         }
         else
@@ -740,7 +741,7 @@ public class LdifReader implements Itera
 
         int initPos = pos;
 
-        while ( StringTools.isCharASCII( controlValue, pos, '.' ) || StringTools.isDigit( controlValue, pos ) )
+        while ( Chars.isCharASCII(controlValue, pos, '.') || Chars.isDigit(controlValue, pos) )
         {
             pos++;
         }
@@ -766,7 +767,7 @@ public class LdifReader implements Itera
 
         // Get the criticality, if any
         // Skip the <fill>
-        while ( StringTools.isCharASCII( controlValue, pos, ' ' ) )
+        while ( Chars.isCharASCII(controlValue, pos, ' ') )
         {
             pos++;
         }
@@ -805,13 +806,13 @@ public class LdifReader implements Itera
         {
             // We have a value. It can be a normal value, a base64 encoded value
             // or a file contained value
-            if ( StringTools.isCharASCII( controlValue, criticalPos + 1, ':' ) )
+            if ( Chars.isCharASCII(controlValue, criticalPos + 1, ':') )
             {
                 // Base 64 encoded value
                 byte[] value = Base64.decode( line.substring( criticalPos + 2 ).toCharArray() );
                 control.setValue( value );
             }
-            else if ( StringTools.isCharASCII( controlValue, criticalPos + 1, '<' ) )
+            else if ( Chars.isCharASCII(controlValue, criticalPos + 1, '<') )
             {
                 // File contained value
                 throw new NotImplementedException( "See DIRSERVER-1547" );
@@ -921,7 +922,7 @@ public class LdifReader implements Itera
                 }
                 else
                 {
-                    entry.setNewRdn( StringTools.utf8ToString( ( byte[] ) attributeValue ) );
+                    entry.setNewRdn( Strings.utf8ToString((byte[]) attributeValue) );
                 }
             }
             else
@@ -1028,7 +1029,7 @@ public class LdifReader implements Itera
                     throw new LdapLdifException( I18n.err( I18n.ERR_12042_BAD_MODIFY_SEPARATOR_2 ) );
                 }
 
-                modified = StringTools.trim( line.substring( "add:".length() ) );
+                modified = Strings.trim(line.substring("add:".length()));
                 modificationType = ModificationOperation.ADD_ATTRIBUTE;
                 attribute = new DefaultEntryAttribute( modified );
 
@@ -1042,7 +1043,7 @@ public class LdifReader implements Itera
                     throw new LdapLdifException( I18n.err( I18n.ERR_12042_BAD_MODIFY_SEPARATOR_2 ) );
                 }
 
-                modified = StringTools.trim( line.substring( "delete:".length() ) );
+                modified = Strings.trim(line.substring("delete:".length()));
                 modificationType = ModificationOperation.REMOVE_ATTRIBUTE;
                 attribute = new DefaultEntryAttribute( modified );
 
@@ -1056,7 +1057,7 @@ public class LdifReader implements Itera
                     throw new LdapLdifException( I18n.err( I18n.ERR_12042_BAD_MODIFY_SEPARATOR_2 ) );
                 }
 
-                modified = StringTools.trim( line.substring( "replace:".length() ) );
+                modified = Strings.trim(line.substring("replace:".length()));
                 modificationType = ModificationOperation.REPLACE_ATTRIBUTE;
                 attribute = new DefaultEntryAttribute( modified );
 
@@ -1189,7 +1190,7 @@ public class LdifReader implements Itera
                         }
                         else
                         {
-                            entry.setNewSuperior( StringTools.utf8ToString( ( byte[] ) attributeValue ) );
+                            entry.setNewSuperior( Strings.utf8ToString((byte[]) attributeValue) );
                         }
                     }
                     else
@@ -1560,7 +1561,7 @@ public class LdifReader implements Itera
      */
     public List<LdifEntry> parseLdifFile( String fileName ) throws LdapLdifException
     {
-        return parseLdifFile( fileName, Charset.forName( StringTools.getDefaultCharsetName() ).toString() );
+        return parseLdifFile( fileName, Charset.forName( Strings.getDefaultCharsetName() ).toString() );
     }
 
 
@@ -1576,7 +1577,7 @@ public class LdifReader implements Itera
     @SuppressWarnings("PMD.EmptyCatchBlock")
     public List<LdifEntry> parseLdifFile( String fileName, String encoding ) throws LdapLdifException
     {
-        if ( StringTools.isEmpty( fileName ) )
+        if ( Strings.isEmpty(fileName) )
         {
             LOG.error( I18n.err( I18n.ERR_12064_EMPTY_FILE_NAME ) );
             throw new LdapLdifException( I18n.err( I18n.ERR_12064_EMPTY_FILE_NAME ) );
@@ -1640,7 +1641,7 @@ public class LdifReader implements Itera
     {
         LOG.debug( "Starts parsing ldif buffer" );
 
-        if ( StringTools.isEmpty( ldif ) )
+        if ( Strings.isEmpty(ldif) )
         {
             return new ArrayList<LdifEntry>();
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java Sat Jan 22 20:08:48 2011
@@ -37,8 +37,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
-import org.apache.directory.shared.ldap.util.Base64;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Base64;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -127,7 +127,7 @@ public final class LdifUtils
      */
     public static boolean isLDIFSafe( String str )
     {
-        if ( StringTools.isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             // A null string is LDIF safe
             return true;
@@ -388,7 +388,7 @@ public final class LdifUtils
 
                     if ( control.hasValue() )
                     {
-                        controlStr.append( "::" ).append( Base64.encode( control.getValue() ) );
+                        controlStr.append( "::" ).append( Base64.encode(control.getValue()) );
                     }
 
                     sb.append( stripLineToNChars( controlStr.toString(), length ) );
@@ -458,7 +458,7 @@ public final class LdifUtils
                 sb.append( '\n' );
 
                 // Stores the optional newSuperior
-                if ( !StringTools.isEmpty( entry.getNewSuperior() ) )
+                if ( !Strings.isEmpty(entry.getNewSuperior()) )
                 {
                     EntryAttribute newSuperior = new DefaultEntryAttribute( "newsuperior", entry.getNewSuperior() );
                     sb.append( convertToLdif( newSuperior, length ) );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java Sat Jan 22 20:08:48 2011
@@ -25,7 +25,6 @@ import java.util.Arrays;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.name.DN;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 
 
@@ -157,7 +156,7 @@ public class BindRequestImpl extends Abs
      */
     public void setCredentials( String credentials )
     {
-        setCredentials( StringTools.getBytesUtf8( credentials ) );
+        setCredentials( Strings.getBytesUtf8(credentials) );
     }
 
 
@@ -494,7 +493,7 @@ public class BindRequestImpl extends Abs
         sb.append( "    BindRequest\n" );
         sb.append( "        Version : '" ).append( isVersion3 ? "3" : "2" ).append( "'\n" );
 
-        if ( StringTools.isEmpty( name.getNormName() ) && isSimple )
+        if ( Strings.isEmpty(name.getNormName()) && isSimple )
         {
             sb.append( "        Name : anonymous\n" );
         }
@@ -504,7 +503,7 @@ public class BindRequestImpl extends Abs
 
             if ( isSimple )
             {
-                sb.append( "        Simple authentication : '" ).append( StringTools.utf8ToString( credentials ) )
+                sb.append( "        Simple authentication : '" ).append( Strings.utf8ToString(credentials) )
                     .append( '/' ).append( Strings.dumpBytes(credentials) ).append( "'\n" );
             }
             else

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java Sat Jan 22 20:08:48 2011
@@ -25,7 +25,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.name.DN;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 
 
@@ -416,7 +415,7 @@ public class CompareRequestImpl extends 
         else
         {
             byte[] binVal = attrVal.getBytes();
-            sb.append( StringTools.utf8ToString( binVal ) ).append( '/' ).append( Strings.dumpBytes(binVal) )
+            sb.append( Strings.utf8ToString(binVal) ).append( '/' ).append( Strings.dumpBytes(binVal) )
                 .append( "'\n" );
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java Sat Jan 22 20:08:48 2011
@@ -26,7 +26,6 @@ import javax.naming.NamingException;
 import javax.naming.ldap.ExtendedResponse;
 
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 
 
@@ -335,7 +334,7 @@ public class ExtendedRequestImpl extends
 
         if ( oid != null )
         {
-            sb.append( "        Request value : '" ).append( StringTools.utf8ToString( requestValue ) ).append( '/' )
+            sb.append( "        Request value : '" ).append( Strings.utf8ToString(requestValue) ).append( '/' )
                 .append( Strings.dumpBytes(requestValue) ).append( "'\n" );
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java Sat Jan 22 20:08:48 2011
@@ -42,7 +42,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -243,14 +243,14 @@ public class LdapEncoder
         }
         else
         {
-            byte[] matchedDNBytes = StringTools.getBytesUtf8( StringTools
-                .trimLeft( ldapResult.getMatchedDn().getName() ) );
+            byte[] matchedDNBytes = Strings.getBytesUtf8(Strings
+                    .trimLeft(ldapResult.getMatchedDn().getName()));
             ldapResultLength += 1 + TLV.getNbBytes( matchedDNBytes.length ) + matchedDNBytes.length;
             ldapResult.setMatchedDnBytes( matchedDNBytes );
         }
 
         // The errorMessage length
-        byte[] errorMessageBytes = StringTools.getBytesUtf8( ldapResult.getErrorMessage() );
+        byte[] errorMessageBytes = Strings.getBytesUtf8(ldapResult.getErrorMessage());
         ldapResultLength += 1 + TLV.getNbBytes( errorMessageBytes.length ) + errorMessageBytes.length;
         ldapResult.setErrorMessageBytes( errorMessageBytes );
 
@@ -522,7 +522,7 @@ public class LdapEncoder
         }
         else
         {
-            byte[] mechanismBytes = StringTools.getBytesUtf8( bindRequest.getSaslMechanism() );
+            byte[] mechanismBytes = Strings.getBytesUtf8(bindRequest.getSaslMechanism());
             int saslMechanismLength = 1 + TLV.getNbBytes( mechanismBytes.length ) + mechanismBytes.length;
             int saslCredentialsLength = 0;
 
@@ -607,7 +607,7 @@ public class LdapEncoder
         int compareRequestLength = 1 + TLV.getNbBytes( DN.getNbBytes( entry ) ) + DN.getNbBytes( entry );
 
         // The attribute value assertion
-        byte[] attributeIdBytes = StringTools.getBytesUtf8( compareRequest.getAttributeId() );
+        byte[] attributeIdBytes = Strings.getBytesUtf8(compareRequest.getAttributeId());
         int avaLength = 1 + TLV.getNbBytes( attributeIdBytes.length ) + attributeIdBytes.length;
         compareRequest.setAttrIdBytes( attributeIdBytes );
 
@@ -619,7 +619,7 @@ public class LdapEncoder
         }
         else
         {
-            byte[] value = StringTools.getBytesUtf8( compareRequest.getAssertionValue().getString() );
+            byte[] value = Strings.getBytesUtf8(compareRequest.getAssertionValue().getString());
             avaLength += 1 + TLV.getNbBytes( value.length ) + value.length;
             compareRequest.setAttrValBytes( value );
         }
@@ -712,7 +712,7 @@ public class LdapEncoder
      */
     private int computeExtendedRequestLength( ExtendedRequestImpl extendedRequest )
     {
-        byte[] requestNameBytes = StringTools.getBytesUtf8( extendedRequest.getRequestName() );
+        byte[] requestNameBytes = Strings.getBytesUtf8(extendedRequest.getRequestName());
 
         extendedRequest.setRequestNameBytes( requestNameBytes );
 
@@ -757,9 +757,9 @@ public class LdapEncoder
 
         String id = extendedResponse.getResponseName();
 
-        if ( !StringTools.isEmpty( id ) )
+        if ( !Strings.isEmpty(id) )
         {
-            byte[] idBytes = StringTools.getBytesUtf8( id );
+            byte[] idBytes = Strings.getBytesUtf8(id);
             extendedResponse.setResponseNameBytes( idBytes );
             int idLength = idBytes.length;
             extendedResponseLength += 1 + TLV.getNbBytes( idLength ) + idLength;
@@ -799,9 +799,9 @@ public class LdapEncoder
     {
         int intermediateResponseLength = 0;
 
-        if ( !StringTools.isEmpty( intermediateResponse.getResponseName() ) )
+        if ( !Strings.isEmpty(intermediateResponse.getResponseName()) )
         {
-            byte[] responseNameBytes = StringTools.getBytesUtf8( intermediateResponse.getResponseName() );
+            byte[] responseNameBytes = Strings.getBytesUtf8(intermediateResponse.getResponseName());
 
             int responseNameLength = responseNameBytes.length;
             intermediateResponseLength += 1 + TLV.getNbBytes( responseNameLength ) + responseNameLength;
@@ -975,7 +975,7 @@ public class LdapEncoder
      */
     private int computeModifyDnRequestLength( ModifyDnRequestImpl modifyDnResponse )
     {
-        int newRdnlength = StringTools.getBytesUtf8( modifyDnResponse.getNewRdn().getName() ).length;
+        int newRdnlength = Strings.getBytesUtf8(modifyDnResponse.getNewRdn().getName()).length;
 
         int modifyDNRequestLength = 1 + TLV.getNbBytes( DN.getNbBytes( modifyDnResponse.getName() ) )
             + DN.getNbBytes( modifyDnResponse.getName() ) + 1 + TLV.getNbBytes( newRdnlength ) + newRdnlength + 1 + 1
@@ -1029,7 +1029,7 @@ public class LdapEncoder
                 // Each referral
                 for ( String ldapUrl : ldapUrls )
                 {
-                    byte[] ldapUrlBytes = StringTools.getBytesUtf8( ldapUrl );
+                    byte[] ldapUrlBytes = Strings.getBytesUtf8(ldapUrl);
                     referralLength += 1 + TLV.getNbBytes( ldapUrlBytes.length ) + ldapUrlBytes.length;
                     referral.addLdapUrlBytes( ldapUrlBytes );
                 }
@@ -1109,7 +1109,7 @@ public class LdapEncoder
             for ( String attribute : searchRequest.getAttributes() )
             {
                 // add the attribute length to the attributes length
-                int idLength = StringTools.getBytesUtf8( attribute ).length;
+                int idLength = Strings.getBytesUtf8(attribute).length;
                 attributeDescriptionListLength += 1 + TLV.getNbBytes( idLength ) + idLength;
             }
         }
@@ -1191,7 +1191,7 @@ public class LdapEncoder
     {
         DN dn = searchResultEntry.getObjectName();
 
-        byte[] dnBytes = StringTools.getBytesUtf8( dn.getName() );
+        byte[] dnBytes = Strings.getBytesUtf8(dn.getName());
 
         // The entry
         int searchResultEntryLength = 1 + TLV.getNbBytes( dnBytes.length ) + dnBytes.length;
@@ -1539,7 +1539,7 @@ public class LdapEncoder
                 // The saslAuthentication Tag
                 buffer.put( ( byte ) LdapConstants.BIND_REQUEST_SASL_TAG );
 
-                byte[] mechanismBytes = StringTools.getBytesUtf8( bindRequest.getSaslMechanism() );
+                byte[] mechanismBytes = Strings.getBytesUtf8(bindRequest.getSaslMechanism());
 
                 buffer.put( TLV
                     .getBytes( bindRequest.getSaslMechanismLength() + bindRequest.getSaslCredentialsLength() ) );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java Sat Jan 22 20:08:48 2011
@@ -34,7 +34,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.DN;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.StringConstants;
 
 
 /**
@@ -214,7 +214,7 @@ public class ModifyRequestImpl extends A
      */
     public void replace( String attributeName )
     {
-        addModification( ModificationOperation.REPLACE_ATTRIBUTE, attributeName, StringTools.EMPTY_STRINGS );
+        addModification( ModificationOperation.REPLACE_ATTRIBUTE, attributeName, StringConstants.EMPTY_STRINGS );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java Sat Jan 22 20:08:48 2011
@@ -32,7 +32,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -316,7 +316,7 @@ public class SearchParams
 
         if ( returningAttributesStr.size() != 0 )
         {
-            sb.append( "    returning attributes : " ).append( StringTools.setToString( returningAttributesStr ) )
+            sb.append( "    returning attributes : " ).append( Strings.setToString(returningAttributesStr) )
                 .append( "\n" );
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java Sat Jan 22 20:08:48 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.StringConstants;
 
 
 /**
@@ -85,7 +85,7 @@ public class CancelResponse extends Exte
      */
     public byte[] getResponse()
     {
-        return StringTools.EMPTY_BYTES;
+        return StringConstants.EMPTY_BYTES;
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java Sat Jan 22 20:08:48 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.StringConstants;
 
 
 /**
@@ -81,7 +81,7 @@ public class CertGenerationResponse exte
      */
     public byte[] getResponse()
     {
-        return StringTools.EMPTY_BYTES;
+        return StringConstants.EMPTY_BYTES;
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java Sat Jan 22 20:08:48 2011
@@ -34,7 +34,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedure.StoredProcedureParameter;
 import org.apache.directory.shared.ldap.message.ExtendedRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultResponse;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -195,7 +195,7 @@ public class StoredProcedureRequest exte
      */
     public void setProcedure( String procedure )
     {
-        this.procedure.setProcedure( StringTools.getBytesUtf8( procedure ) );
+        this.procedure.setProcedure( Strings.getBytesUtf8(procedure) );
     }
 
 
@@ -206,7 +206,7 @@ public class StoredProcedureRequest exte
      */
     public String getProcedureSpecification()
     {
-        return StringTools.utf8ToString( procedure.getProcedure() );
+        return Strings.utf8ToString(procedure.getProcedure());
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java Sat Jan 22 20:08:48 2011
@@ -32,7 +32,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.UTFUtils;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
@@ -167,12 +166,12 @@ public class AVA implements Cloneable, C
      */
     public AVA( String upType, String normType, Value<?> upValue, Value<?> normValue ) throws LdapInvalidDnException
     {
-        String upTypeTrimmed = StringTools.trim( upType );
-        String normTypeTrimmed = StringTools.trim( normType );
+        String upTypeTrimmed = Strings.trim(upType);
+        String normTypeTrimmed = Strings.trim(normType);
         
-        if ( StringTools.isEmpty( upTypeTrimmed ) )
+        if ( Strings.isEmpty(upTypeTrimmed) )
         {
-            if ( StringTools.isEmpty( normTypeTrimmed ) )
+            if ( Strings.isEmpty(normTypeTrimmed) )
             {
                 String message =  I18n.err( I18n.ERR_04188 );
                 LOG.error( message );
@@ -181,19 +180,19 @@ public class AVA implements Cloneable, C
             else
             {
                 // In this case, we will use the normType instead
-                this.normType = StringTools.lowerCaseAscii( normTypeTrimmed );
+                this.normType = Strings.lowerCaseAscii(normTypeTrimmed);
                 this.upType = normType;
             }
         }
-        else if ( StringTools.isEmpty( normTypeTrimmed ) )
+        else if ( Strings.isEmpty(normTypeTrimmed) )
         {
             // In this case, we will use the upType instead
-            this.normType = StringTools.lowerCaseAscii( upTypeTrimmed );
+            this.normType = Strings.lowerCaseAscii(upTypeTrimmed);
             this.upType = upType;
         }
         else
         {
-            this.normType = StringTools.lowerCaseAscii( normTypeTrimmed );
+            this.normType = Strings.lowerCaseAscii(normTypeTrimmed);
             this.upType = upType;
             
         }
@@ -224,12 +223,12 @@ public class AVA implements Cloneable, C
     public AVA( String upType, String normType, Value<?> upValue, Value<?> normValue, String upName )
         throws LdapInvalidDnException
     {
-        String upTypeTrimmed = StringTools.trim( upType );
-        String normTypeTrimmed = StringTools.trim( normType );
+        String upTypeTrimmed = Strings.trim(upType);
+        String normTypeTrimmed = Strings.trim(normType);
 
-        if ( StringTools.isEmpty( upTypeTrimmed ) )
+        if ( Strings.isEmpty(upTypeTrimmed) )
         {
-            if ( StringTools.isEmpty( normTypeTrimmed ) )
+            if ( Strings.isEmpty(normTypeTrimmed) )
             {
                 String message = I18n.err( I18n.ERR_04188 );
                 LOG.error( message );
@@ -238,19 +237,19 @@ public class AVA implements Cloneable, C
             else
             {
                 // In this case, we will use the normType instead
-                this.normType = StringTools.lowerCaseAscii( normTypeTrimmed );
+                this.normType = Strings.lowerCaseAscii(normTypeTrimmed);
                 this.upType = normType;
             }
         }
-        else if ( StringTools.isEmpty( normTypeTrimmed ) )
+        else if ( Strings.isEmpty(normTypeTrimmed) )
         {
             // In this case, we will use the upType instead
-            this.normType = StringTools.lowerCaseAscii( upTypeTrimmed );
+            this.normType = Strings.lowerCaseAscii(upTypeTrimmed);
             this.upType = upType;
         }
         else
         {
-            this.normType = StringTools.lowerCaseAscii( normTypeTrimmed );
+            this.normType = Strings.lowerCaseAscii(normTypeTrimmed);
             this.upType = upType;
 
         }
@@ -448,17 +447,17 @@ public class AVA implements Cloneable, C
      */
     private int compareType( String val1, String val2 )
     {
-        if ( StringTools.isEmpty( val1 ) )
+        if ( Strings.isEmpty(val1) )
         {
-            return StringTools.isEmpty( val2 ) ? 0 : -1;
+            return Strings.isEmpty(val2) ? 0 : -1;
         }
-        else if ( StringTools.isEmpty( val2 ) )
+        else if ( Strings.isEmpty(val2) )
         {
             return 1;
         }
         else
         {
-            return ( StringTools.trim( val1 ) ).compareToIgnoreCase( StringTools.trim( val2 ) );
+            return ( Strings.trim(val1) ).compareToIgnoreCase( Strings.trim(val2) );
         }
     }
 
@@ -746,9 +745,9 @@ public class AVA implements Cloneable, C
      */
     public void writeExternal( ObjectOutput out ) throws IOException
     {
-        if ( StringTools.isEmpty( upName )
-            || StringTools.isEmpty( upType )
-            || StringTools.isEmpty( normType )
+        if ( Strings.isEmpty(upName)
+            || Strings.isEmpty(upType)
+            || Strings.isEmpty(normType)
             || ( start < 0 )
             || ( length < 2 ) // At least a type and '='
             || ( upValue.isNull() )
@@ -756,15 +755,15 @@ public class AVA implements Cloneable, C
         {
             String message = "Cannot serialize an wrong ATAV, ";
             
-            if ( StringTools.isEmpty( upName ) )
+            if ( Strings.isEmpty(upName) )
             {
                 message += "the upName should not be null or empty";
             }
-            else if ( StringTools.isEmpty( upType ) )
+            else if ( Strings.isEmpty(upType) )
             {
                 message += "the upType should not be null or empty";
             }
-            else if ( StringTools.isEmpty( normType ) )
+            else if ( Strings.isEmpty(normType) )
             {
                 message += "the normType should not be null or empty";
             }
@@ -860,7 +859,7 @@ public class AVA implements Cloneable, C
     {
         StringBuffer sb = new StringBuffer();
 
-        if ( StringTools.isEmpty( normType ) || StringTools.isEmpty( normType.trim() ) )
+        if ( Strings.isEmpty(normType) || Strings.isEmpty(normType.trim()) )
         {
             return "";
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java Sat Jan 22 20:08:48 2011
@@ -27,8 +27,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.UTFUtils;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -80,9 +80,9 @@ public final class AVASerializer
      */
     public static void serialize( AVA atav, ObjectOutput out ) throws IOException
     {
-        if ( StringTools.isEmpty( atav.getUpName() )
-            || StringTools.isEmpty( atav.getUpType() )
-            || StringTools.isEmpty( atav.getNormType() )
+        if ( Strings.isEmpty(atav.getUpName())
+            || Strings.isEmpty(atav.getUpType())
+            || Strings.isEmpty(atav.getNormType())
             || ( atav.getStart() < 0 )
             || ( atav.getLength() < 2 ) // At least a type and '='
             || ( atav.getUpValue().isNull() )
@@ -90,15 +90,15 @@ public final class AVASerializer
         {
             String message = "Cannot serialize an wrong ATAV, ";
             
-            if ( StringTools.isEmpty( atav.getUpName() ) )
+            if ( Strings.isEmpty(atav.getUpName()) )
             {
                 message += "the upName should not be null or empty";
             }
-            else if ( StringTools.isEmpty( atav.getUpType() ) )
+            else if ( Strings.isEmpty(atav.getUpType()) )
             {
                 message += "the upType should not be null or empty";
             }
-            else if ( StringTools.isEmpty( atav.getNormType() ) )
+            else if ( Strings.isEmpty(atav.getNormType()) )
             {
                 message += "the normType should not be null or empty";
             }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java Sat Jan 22 20:08:48 2011
@@ -35,7 +35,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -409,7 +409,7 @@ public class DN implements Cloneable, Se
         {
             this.normName = rdn.getNormName();
             this.upName = rdn.getName();
-            this.bytes = StringTools.getBytesUtf8( normName );
+            this.bytes = Strings.getBytesUtf8(normName);
             normalized = new AtomicBoolean( true );
         }
         else
@@ -502,7 +502,7 @@ public class DN implements Cloneable, Se
 
             if ( ( normName == null ) || !normName.equals( newNormName ) )
             {
-                bytes = StringTools.getBytesUtf8( newNormName );
+                bytes = Strings.getBytesUtf8(newNormName);
                 normName = newNormName;
             }
 
@@ -1095,7 +1095,7 @@ public class DN implements Cloneable, Se
         // Concatenate the rdns
         clonedDn.rdns.addAll( clonedDn.size() - posn, dn.rdns );
 
-        if ( StringTools.isEmpty( normName ) )
+        if ( Strings.isEmpty(normName) )
         {
             clonedDn.normName = dn.normName;
             clonedDn.bytes = dn.bytes;
@@ -1104,7 +1104,7 @@ public class DN implements Cloneable, Se
         else
         {
             clonedDn.normName = dn.normName + "," + normName;
-            clonedDn.bytes = StringTools.getBytesUtf8( normName );
+            clonedDn.bytes = Strings.getBytesUtf8(normName);
             clonedDn.upName = dn.upName + "," + upName;
         }
 
@@ -1142,7 +1142,7 @@ public class DN implements Cloneable, Se
             if ( clonedDn.size() != 0 )
             {
                 clonedDn.normName = dn.getNormName() + "," + normName;
-                clonedDn.bytes = StringTools.getBytesUtf8( normName );
+                clonedDn.bytes = Strings.getBytesUtf8(normName);
                 clonedDn.upName = dn.getName() + "," + upName;
             }
         }
@@ -1427,14 +1427,14 @@ public class DN implements Cloneable, Se
     private static AVA atavOidToName( AVA atav, Map<String, OidNormalizer> oidsMap )
         throws LdapInvalidDnException
     {
-        String type = StringTools.trim( atav.getNormType() );
+        String type = Strings.trim(atav.getNormType());
 
         if ( ( type.startsWith( "oid." ) ) || ( type.startsWith( "OID." ) ) )
         {
             type = type.substring( 4 );
         }
 
-        if ( StringTools.isNotEmpty( type ) )
+        if ( Strings.isNotEmpty(type) )
         {
             if ( oidsMap == null )
             {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java Sat Jan 22 20:08:48 2011
@@ -26,8 +26,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.UTFUtils;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -140,7 +140,7 @@ public final class DnSerializer
         }
         
         // Should we read the byte[] ???
-        byte[] bytes = StringTools.getBytesUtf8( upName );
+        byte[] bytes = Strings.getBytesUtf8(upName);
         
         // Read the RDNs. Is it's null, the number will be -1.
         int nbRdns = in.readInt();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/FastDnParser.java Sat Jan 22 20:08:48 2011
@@ -27,8 +27,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.util.Position;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Position;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -169,7 +169,7 @@ public enum FastDnParser
         // here we only match "simple" values
         // stops at \ + # " -> Too Complex Exception
         String upValue = matchValue( name, pos );
-        String value = StringTools.trimRight( upValue );
+        String value = Strings.trimRight(upValue);
         // TODO: trim, normalize, etc
 
         // SPACE*

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java Sat Jan 22 20:08:48 2011
@@ -40,9 +40,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.UTFUtils;
-import org.apache.directory.shared.util.Strings;
+import org.apache.directory.shared.util.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -234,7 +233,7 @@ public class RDN implements Cloneable, C
     {
         start = 0;
 
-        if ( StringTools.isNotEmpty( rdn ) )
+        if ( Strings.isNotEmpty(rdn) )
         {
             // Parse the string. The Rdn will be updated.
             RdnParser.parse( rdn, this );
@@ -563,7 +562,7 @@ public class RDN implements Cloneable, C
     {
         // First, let's normalize the type
         Value<?> normalizedValue = value;
-        String normalizedType = StringTools.lowerCaseAscii( type );
+        String normalizedType = Strings.lowerCaseAscii(type);
 
         if( schemaManager != null )
         {
@@ -698,7 +697,7 @@ public class RDN implements Cloneable, C
     public Object getValue( String type ) throws LdapInvalidDnException
     {
         // First, let's normalize the type
-        String normalizedType = StringTools.lowerCaseAscii( StringTools.trim( type ) );
+        String normalizedType = Strings.lowerCaseAscii(Strings.trim(type));
 
         switch ( nbAtavs )
         {
@@ -706,7 +705,7 @@ public class RDN implements Cloneable, C
                 return "";
 
             case 1:
-                if ( StringTools.equals( atav.getNormType(), normalizedType ) )
+                if ( Strings.equals(atav.getNormType(), normalizedType) )
                 {
                     return atav.getNormValue().get();
                 }
@@ -776,7 +775,7 @@ public class RDN implements Cloneable, C
     public AVA getAttributeTypeAndValue( String type )
     {
         // First, let's normalize the type
-        String normalizedType = StringTools.lowerCaseAscii( StringTools.trim( type ) );
+        String normalizedType = Strings.lowerCaseAscii(Strings.trim(type));
 
         switch ( nbAtavs )
         {
@@ -1165,7 +1164,7 @@ public class RDN implements Cloneable, C
      */
     public static Object unescapeValue( String value ) throws IllegalArgumentException
     {
-        if ( StringTools.isEmpty( value ) )
+        if ( Strings.isEmpty(value) )
         {
             return "";
         }
@@ -1177,7 +1176,7 @@ public class RDN implements Cloneable, C
             if ( chars.length == 1 )
             {
                 // The value is only containing a #
-                return StringTools.EMPTY_BYTES;
+                return StringConstants.EMPTY_BYTES;
             }
 
             if ( ( chars.length % 2 ) != 1 )
@@ -1191,9 +1190,9 @@ public class RDN implements Cloneable, C
 
             for ( int i = 1; i < chars.length; i += 2 )
             {
-                if ( StringTools.isHex( chars, i ) && StringTools.isHex( chars, i + 1 ) )
+                if ( Chars.isHex(chars, i) && Chars.isHex(chars, i + 1) )
                 {
-                    hexValue[pos++] = StringTools.getHexValue( chars[i], chars[i + 1] );
+                    hexValue[pos++] = Hex.getHexValue(chars[i], chars[i + 1]);
                 }
                 else
                 {
@@ -1234,10 +1233,10 @@ public class RDN implements Cloneable, C
                             break;
 
                         default:
-                            if ( StringTools.isHex( chars, i ) )
+                            if ( Chars.isHex(chars, i) )
                             {
                                 isHex = true;
-                                pair = ( ( byte ) ( StringTools.getHexValue( chars[i] ) << 4 ) );
+                                pair = ( ( byte ) ( Hex.getHexValue(chars[i]) << 4 ) );
                             }
 
                             break;
@@ -1247,9 +1246,9 @@ public class RDN implements Cloneable, C
                 {
                     if ( isHex )
                     {
-                        if ( StringTools.isHex( chars, i ) )
+                        if ( Chars.isHex(chars, i) )
                         {
-                            pair += StringTools.getHexValue( chars[i] );
+                            pair += Hex.getHexValue(chars[i]);
                             bytes[pos++] = pair;
                         }
                     }
@@ -1298,7 +1297,7 @@ public class RDN implements Cloneable, C
                                 }
                                 else
                                 {
-                                    byte[] result = StringTools.charToBytes( chars[i] );
+                                    byte[] result = Unicode.charToBytes(chars[i]);
                                     System.arraycopy( result, 0, bytes, pos, result.length );
                                     pos += result.length;
                                 }
@@ -1309,7 +1308,7 @@ public class RDN implements Cloneable, C
                 }
             }
 
-            return StringTools.utf8ToString( bytes, pos );
+            return Strings.utf8ToString(bytes, pos);
         }
     }
 
@@ -1322,7 +1321,7 @@ public class RDN implements Cloneable, C
      */
     public static String escapeValue( String value )
     {
-        if ( StringTools.isEmpty( value ) )
+        if ( Strings.isEmpty(value) )
         {
             return "";
         }
@@ -1441,12 +1440,12 @@ public class RDN implements Cloneable, C
      */
     public static String escapeValue( byte[] attrValue )
     {
-        if ( StringTools.isEmpty( attrValue ) )
+        if ( Strings.isEmpty(attrValue) )
         {
             return "";
         }
 
-        String value = StringTools.utf8ToString( attrValue );
+        String value = Strings.utf8ToString(attrValue);
 
         return escapeValue( value );
     }
@@ -1597,7 +1596,7 @@ public class RDN implements Cloneable, C
         // Read the normName
         normName = UTFUtils.readUTF( in );
 
-        if ( StringTools.isEmpty( normName ) )
+        if ( Strings.isEmpty(normName) )
         {
             normName = upName;
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java Sat Jan 22 20:08:48 2011
@@ -23,8 +23,8 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.UTFUtils;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -119,7 +119,7 @@ public final class RdnSerializer
         // Read the normName
         String normName = UTFUtils.readUTF( in );
         
-        if ( StringTools.isEmpty( normName ) )
+        if ( Strings.isEmpty(normName) )
         {
             normName = upName;
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java Sat Jan 22 20:08:48 2011
@@ -31,7 +31,7 @@ import java.util.Set;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -263,14 +263,14 @@ public abstract class AbstractSchemaObje
             // Fills a set with all the existing names
             for ( String name : this.names )
             {
-                lowerNames.add( StringTools.toLowerCase( name ) );
+                lowerNames.add( Strings.toLowerCase(name) );
             }
 
             for ( String name : namesToAdd )
             {
                 if ( name != null )
                 {
-                    String lowerName = StringTools.toLowerCase( name );
+                    String lowerName = Strings.toLowerCase(name);
                     // Check that the lower cased names is not already present
                     if ( !lowerNames.contains( lowerName ) )
                     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeTypeOptions.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeTypeOptions.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeTypeOptions.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeTypeOptions.java Sat Jan 22 20:08:48 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -105,7 +105,7 @@ public class AttributeTypeOptions
     {
         if ( hasOption() )
         {
-            return options.contains( StringTools.toLowerCase( StringTools.trim( option ) ) );
+            return options.contains( Strings.toLowerCase(Strings.trim(option)) );
         }
         else
         {
@@ -126,7 +126,7 @@ public class AttributeTypeOptions
             options = new HashSet<String>();
         }
 
-        options.add( StringTools.toLowerCase( StringTools.trim( option ) ) );
+        options.add( Strings.toLowerCase(Strings.trim(option)) );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java Sat Jan 22 20:08:48 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -193,7 +193,7 @@ public abstract class LoadableSchemaObje
     {
         String className = this.getClass().getName();
 
-        if ( StringTools.isEmpty( fqcn ) )
+        if ( Strings.isEmpty(fqcn) )
         {
             fqcn = className;
             return true;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java Sat Jan 22 20:08:48 2011
@@ -22,8 +22,8 @@ package org.apache.directory.shared.ldap
 
 import java.io.IOException;
 
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.unicode.InvalidCharacterException;
+import org.apache.directory.shared.util.Strings;
 
 /**
  * 
@@ -4611,7 +4611,7 @@ public final class PrepareString
      */
     private static String insignifiantCharTelephoneNumber( String str )
     {
-        if ( StringTools.isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             return "";
         }
@@ -4665,7 +4665,7 @@ public final class PrepareString
      */
     private static String insignifiantCharNumericString( String str )
     {
-        if ( StringTools.isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             return "";
         }
@@ -4710,7 +4710,7 @@ public final class PrepareString
      */
     private static String insignifiantSpacesString( String str, boolean caseSensitive ) throws InvalidCharacterException
     {
-        if ( StringTools.isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             // Special case : an empty strings is replaced by 2 spaces
             return "";

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java Sat Jan 22 20:08:48 2011
@@ -33,7 +33,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -1081,7 +1081,7 @@ public final class SchemaUtils
 
         buf.append( " FQCN " ).append( description.getFqcn() );
 
-        if ( !StringTools.isEmpty( description.getBytecode() ) )
+        if ( !Strings.isEmpty(description.getBytecode()) )
         {
             buf.append( " BYTECODE " ).append( description.getBytecode() );
         }
@@ -1150,7 +1150,7 @@ public final class SchemaUtils
             
             for ( String option:res )
             {
-                if ( !StringTools.isEmpty( option ) )
+                if ( !Strings.isEmpty(option) )
                 {
                     options.add( option );
                 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/GeneralizedTimeComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/GeneralizedTimeComparator.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/GeneralizedTimeComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/GeneralizedTimeComparator.java Sat Jan 22 20:08:48 2011
@@ -26,7 +26,7 @@ import java.text.ParseException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.PrepareString;
-import org.apache.directory.shared.ldap.util.GeneralizedTime;
+import org.apache.directory.shared.util.GeneralizedTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectClassTypeComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectClassTypeComparator.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectClassTypeComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectClassTypeComparator.java Sat Jan 22 20:08:48 2011
@@ -21,7 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.schema.LdapComparator;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -79,7 +79,7 @@ public class ObjectClassTypeComparator<T
         }
         else if ( obj instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) obj ); 
+            strValue = Strings.utf8ToString((byte[]) obj);
         }
         else
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierFirstComponentComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierFirstComponentComparator.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierFirstComponentComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierFirstComponentComparator.java Sat Jan 22 20:08:48 2011
@@ -22,7 +22,7 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.shared.asn1.util.OID;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Chars;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -71,7 +71,7 @@ public class ObjectIdentifierFirstCompon
         
         int start = pos;
         
-        while ( StringTools.isDigit( s, pos ) || Strings.isCharASCII( s, pos, '.' ) )
+        while ( Chars.isDigit(s, pos) || Strings.isCharASCII( s, pos, '.' ) )
         {
             pos++;
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/WordComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/WordComparator.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/WordComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/WordComparator.java Sat Jan 22 20:08:48 2011
@@ -21,7 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.schema.LdapComparator;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -84,7 +84,7 @@ public class WordComparator extends Ldap
         }
 
         // Now, trim the assertion and find it in the value
-        String trimmedAssertion = StringTools.trim( assertion );
+        String trimmedAssertion = Strings.trim(assertion);
         int pos = value.indexOf( trimmedAssertion );
 
         if ( pos != -1 )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java Sat Jan 22 20:08:48 2011
@@ -30,7 +30,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Hex;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -96,7 +96,7 @@ public class ConcreteNameComponentNormal
                 case 2 :
                     escaped=0;
                     low = c;
-                    newVal[pos++] = (char)StringTools.getHexValue( high, low );
+                    newVal[pos++] = (char) Hex.getHexValue(high, low);
                     
             }
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DefaultStringNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DefaultStringNormalizer.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DefaultStringNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DefaultStringNormalizer.java Sat Jan 22 20:08:48 2011
@@ -24,7 +24,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.Normalizer;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -57,7 +57,7 @@ public class DefaultStringNormalizer ext
     {
         String str = value.getString();
         
-        if ( StringTools.isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             return new StringValue( str );
         }
@@ -71,7 +71,7 @@ public class DefaultStringNormalizer ext
      */
     public String normalize( String value ) throws LdapException
     {
-        if ( StringTools.isEmpty( value ) )
+        if ( Strings.isEmpty(value) )
         {
             return value;
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java Sat Jan 22 20:08:48 2011
@@ -32,10 +32,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.PrepareString;
-import org.apache.directory.shared.ldap.util.GeneralizedTime;
-import org.apache.directory.shared.ldap.util.GeneralizedTime.Format;
-import org.apache.directory.shared.ldap.util.GeneralizedTime.FractionDelimiter;
-import org.apache.directory.shared.ldap.util.GeneralizedTime.TimeZoneFormat;
+import org.apache.directory.shared.util.GeneralizedTime;
+import org.apache.directory.shared.util.GeneralizedTime.Format;
+import org.apache.directory.shared.util.GeneralizedTime.FractionDelimiter;
+import org.apache.directory.shared.util.GeneralizedTime.TimeZoneFormat;
 
 
 /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java?rev=1062251&r1=1062250&r2=1062251&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java Sat Jan 22 20:08:48 2011
@@ -28,7 +28,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -100,7 +100,7 @@ public class UniqueMemberNormalizer exte
 
     public String normalize( String value ) throws LdapException
     {
-        if ( StringTools.isEmpty( value ) )
+        if ( Strings.isEmpty(value) )
         {
             return null;
         }



Mime
View raw message