You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2011/01/22 23:37:12 UTC

svn commit: r1062285 [3/5] - in /directory: apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/changelog/ apacheds/trunk/core-api/src/main/java/...

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java Sat Jan 22 22:37:04 2011
@@ -33,12 +33,12 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.ldap.message.AddResponse;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java Sat Jan 22 22:37:04 2011
@@ -33,12 +33,12 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.ldap.message.BindResponse;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java Sat Jan 22 22:37:04 2011
@@ -33,12 +33,12 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.ldap.message.CompareResponse;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java Sat Jan 22 22:37:04 2011
@@ -33,12 +33,12 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.ldap.message.DeleteResponse;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java Sat Jan 22 22:37:04 2011
@@ -35,12 +35,12 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.util.OID;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java Sat Jan 22 22:37:04 2011
@@ -33,12 +33,12 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ModifyDnResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java Sat Jan 22 22:37:04 2011
@@ -33,12 +33,12 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ModifyResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java Sat Jan 22 22:37:04 2011
@@ -34,12 +34,12 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
 import org.apache.directory.shared.dsmlv2.reponse.SearchResponse;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.SearchResultDone;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java Sat Jan 22 22:37:04 2011
@@ -33,10 +33,10 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser;
 import org.apache.directory.shared.dsmlv2.reponse.SearchResponse;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.ldap.message.SearchResultReference;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java (original)
+++ directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java Sat Jan 22 22:37:04 2011
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;

Modified: directory/shared/trunk/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schemaloader/LdifSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schemaloader/LdifSchemaLoaderTest.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schemaloader/LdifSchemaLoaderTest.java (original)
+++ directory/shared/trunk/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schemaloader/LdifSchemaLoaderTest.java Sat Jan 22 22:37:04 2011
@@ -32,9 +32,8 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schemaextractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
-import org.apache.directory.shared.ldap.schemaloader.LdifSchemaLoader;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
-import org.apache.directory.shared.ldap.util.LdapExceptionUtils;
+import org.apache.directory.shared.util.exception.Exceptions;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -91,7 +90,7 @@ public class LdifSchemaLoaderTest
         
         if ( !loaded )
         {
-            fail( "Schema load failed : " + LdapExceptionUtils.printErrors( sm.getErrors() ) );
+            fail( "Schema load failed : " + Exceptions.printErrors(sm.getErrors()) );
         }
         
         assertTrue( sm.getRegistries().getAttributeTypeRegistry().contains( "cn" ) );

Modified: directory/shared/trunk/ldap/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/ACIItem.g?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/ACIItem.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/ACIItem.g Sat Jan 22 22:37:04 2011
@@ -45,8 +45,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.util.ComponentsMonitor;
 import org.apache.directory.shared.util.MandatoryAndOptionalComponentsMonitor;
 import org.apache.directory.shared.util.MandatoryComponentsMonitor;
-import org.apache.directory.shared.ldap.util.NamespaceTools;
-import org.apache.directory.shared.ldap.util.NoDuplicateKeysMap;
+import org.apache.directory.shared.ldap.name.DnUtils;
+import org.apache.directory.shared.util.NoDuplicateKeysMap;
 import org.apache.directory.shared.util.OptionalComponentsMonitor;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
@@ -505,8 +505,8 @@ attributeValue
         for ( RDN rdn : attributeTypeAndValueSetAsDn )
         {
             attributeTypeAndValue = rdn.getNormName();
-            attributeType = NamespaceTools.getRdnAttribute( attributeTypeAndValue );
-            attributeValue = NamespaceTools.getRdnValue( attributeTypeAndValue );
+            attributeType = DnUtils.getRdnAttribute( attributeTypeAndValue );
+            attributeValue = DnUtils.getRdnValue( attributeTypeAndValue );
             
             attributeSet.add( new DefaultEntryAttribute( attributeType, attributeValue ) );
             log.debug( "An attributeTypeAndValue from the set: " + attributeType + "=" +  attributeValue);

Modified: directory/shared/trunk/ldap/src/main/antlr/distinguishedName.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/distinguishedName.g?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/distinguishedName.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/distinguishedName.g Sat Jan 22 22:37:04 2011
@@ -31,7 +31,6 @@ import javax.naming.NameParser;
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.BinaryValue;
 import org.apache.directory.shared.ldap.schema.parsers.ParserMonitor;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/AttributeValueAssertion.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/AttributeValueAssertion.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/AttributeValueAssertion.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/AttributeValueAssertion.java Sat Jan 22 22:37:04 2011
@@ -19,8 +19,8 @@
  */
 package org.apache.directory.shared.ldap.codec;
 
-import org.apache.directory.shared.ldap.entry.Value;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.ldap.entry.*;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -48,6 +48,43 @@ public class AttributeValueAssertion
     /** The assertion value */
     private Value<?> assertionValue;
 
+    /**
+     *
+     * Helper method to render an object which can be a String or a byte[]
+     *
+     * @return A string representing the object
+     */
+    public static String dumpObject( Object object )
+    {
+        if ( object != null )
+        {
+            if ( object instanceof String )
+            {
+                return (String) object;
+            }
+            else if ( object instanceof byte[] )
+            {
+                return Strings.dumpBytes((byte[]) object);
+            }
+            else if ( object instanceof StringValue)
+            {
+                return ( ( StringValue ) object ).get();
+            }
+            else if ( object instanceof BinaryValue )
+            {
+                return Strings.dumpBytes(((BinaryValue) object).get());
+            }
+            else
+            {
+                return "<unknown type>";
+            }
+        }
+        else
+        {
+            return "";
+        }
+    }
+
 
     // ~ Methods
     // ------------------------------------------------------------------------------------
@@ -110,7 +147,7 @@ public class AttributeValueAssertion
         sb.append( tabs ).append( "    Assertion description : '" );
         sb.append( attributeDesc != null ? attributeDesc : "null" );
         sb.append( "'\n" );
-        sb.append( tabs ).append( "    Assertion value : '" ).append( StringTools.dumpObject( assertionValue ) ).append( "'\n" );
+        sb.append( tabs ).append( "    Assertion value : '" ).append( dumpObject(assertionValue) ).append( "'\n" );
 
         return sb.toString();
     }
@@ -148,7 +185,7 @@ public class AttributeValueAssertion
                 break;
         }
 
-        sb.append( StringTools.dumpObject( assertionValue ) );
+        sb.append( dumpObject(assertionValue) );
 
         return sb.toString();
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java Sat Jan 22 22:37:04 2011
@@ -120,7 +120,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.StringConstants;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
@@ -1239,7 +1238,7 @@ public final class LdapMessageGrammar ex
                     }
                     else
                     {
-                        type = StringTools.getType( tlv.getValue().getData() );
+                        type = getType(tlv.getValue().getData());
 
                         try
                         {
@@ -1615,7 +1614,7 @@ public final class LdapMessageGrammar ex
                     }
                     else
                     {
-                        type = StringTools.getType( tlv.getValue().getData() );
+                        type = getType(tlv.getValue().getData());
                         ( ( ModifyRequestImpl ) modifyRequest ).addAttributeTypeAndValues( type );
                     }
 
@@ -1956,7 +1955,7 @@ public final class LdapMessageGrammar ex
                             addRequest.getEntry().getDn(), null );
                     }
 
-                    String type = StringTools.getType( tlv.getValue().getData() );
+                    String type = getType(tlv.getValue().getData());
 
                     try
                     {
@@ -2602,7 +2601,7 @@ public final class LdapMessageGrammar ex
                             compareRequest.getName(), null );
                     }
 
-                    String type = StringTools.getType( tlv.getValue().getData() );
+                    String type = getType(tlv.getValue().getData());
                     compareRequest.setAttributeId( type );
 
                     if ( IS_DEBUG )
@@ -5050,7 +5049,7 @@ public final class LdapMessageGrammar ex
                     }
                     else
                     {
-                        String type = StringTools.getType( tlv.getValue().getData() );
+                        String type = getType(tlv.getValue().getData());
                         substringFilter.setType( type );
 
                         // We now have to get back to the nearest filter which
@@ -6600,4 +6599,29 @@ public final class LdapMessageGrammar ex
     {
         return instance;
     }
+
+    /**
+     * Build an AttributeType froma byte array. An AttributeType contains
+     * only chars within [0-9][a-z][A-Z][-.].
+     *
+     * @param bytes The bytes containing the AttributeType
+     * @return The AttributeType as a String
+     */
+    public static String getType( byte[] bytes )
+    {
+        if ( bytes == null )
+        {
+            return null;
+        }
+
+        char[] chars = new char[bytes.length];
+        int pos = 0;
+
+        for ( byte b:bytes )
+        {
+            chars[pos++] = ( char ) b;
+        }
+
+        return new String( chars );
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java Sat Jan 22 22:37:04 2011
@@ -26,13 +26,13 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.Message;
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.ResultResponse;
-import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java Sat Jan 22 22:37:04 2011
@@ -26,11 +26,11 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
 import org.apache.directory.shared.ldap.message.SearchResultReference;
-import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnect.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnect.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnect.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnect.java Sat Jan 22 22:37:04 2011
@@ -30,7 +30,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.ldap.codec.extended.operations.GracefulAction;
 import org.apache.directory.shared.ldap.codec.extended.operations.GracefulActionConstants;
-import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 
 
 /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnectGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnectGrammar.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnectGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnectGrammar.java Sat Jan 22 22:37:04 2011
@@ -32,8 +32,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.IntegerDecoder;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.extended.operations.GracefulActionConstants;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AttributeUtils.java (from r1062251, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AttributeUtils.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AttributeUtils.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java&r1=1062251&r2=1062285&rev=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AttributeUtils.java Sat Jan 22 22:37:04 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.shared.ldap.util;
+package org.apache.directory.shared.ldap.entry;
 
 
 import java.text.ParseException;
@@ -448,58 +448,6 @@ public final class AttributeUtils
     }
 
 
-    /*
-    public static boolean containsAnyValues( Attribute attr, Object[] compared, AttributeType type )
-        throws NamingException
-    {
-        // quick bypass test
-        for ( Object object : compared )
-        {
-            if ( attr.contains( object ) )
-            {
-                return true;
-            }
-        }
-
-        Normalizer normalizer = type.getEquality().getNormalizer();
-
-        if ( type.getSyntax().isHumanReadable() )
-        {
-            for ( Object object : compared )
-            {
-                String comparedStr = ( String ) normalizer.normalize( object );
-
-                for ( int ii = attr.size(); ii >= 0; ii-- )
-                {
-                    String value = ( String ) attr.get( ii );
-
-                    if ( comparedStr.equals( normalizer.normalize( value ) ) )
-                    {
-                        return true;
-                    }
-                }
-            }
-        }
-        else
-        {
-            for ( Object object : compared )
-            {
-                byte[] comparedBytes = ( byte[] ) object;
-
-                for ( int ii = attr.size(); ii >= 0; ii-- )
-                {
-                    if ( ArrayUtils.isEquals( comparedBytes, attr.get( ii ) ) )
-                    {
-                        return true;
-                    }
-                }
-            }
-        }
-
-        return false;
-    }
-    */
-
     /**
      * Creates a new attribute which contains the values representing the
      * difference of two attributes. If both attributes are null then we cannot
@@ -1071,130 +1019,6 @@ public final class AttributeUtils
     }
 
 
-    /*
-     * Check if an attribute contains a specific value and remove it using the associated
-     * matchingRule for the attribute type supplied.
-     *
-     * @param attr the attribute we are searching in
-     * @param compared the object we are looking for
-     * @param type the attribute type
-     * @return the value removed from the attribute, otherwise null
-     * @throws NamingException if something went wrong while removing the value
-     *
-    public static Object removeValue( Attribute attr, Object compared, AttributeType type ) throws NamingException
-    {
-        // quick bypass test
-        if ( attr.contains( compared ) )
-        {
-            return attr.remove( compared );
-        }
-
-        MatchingRule matchingRule = type.getEquality();
-        Normalizer normalizer;
-
-        if ( matchingRule != null )
-        {
-            normalizer = type.getEquality().getNormalizer();
-        }
-        else
-        {
-            normalizer = new NoOpNormalizer();
-        }
-
-        if ( type.getSyntax().isHumanReadable() )
-        {
-            String comparedStr = ( String ) normalizer.normalize( compared );
-
-            for ( NamingEnumeration<?> values = attr.getAll(); values.hasMoreElements(); )
-            {
-                String value = ( String ) values.nextElement();
-                if ( comparedStr.equals( normalizer.normalize( value ) ) )
-                {
-                    return attr.remove( value );
-                }
-            }
-        }
-        else
-        {
-            byte[] comparedBytes = null;
-
-            if ( compared instanceof String )
-            {
-                if ( ( ( String ) compared ).length() < 3 )
-                {
-                    return null;
-                }
-
-                // Tansform the String to a byte array
-                int state = 1;
-                comparedBytes = new byte[( ( String ) compared ).length() / 3];
-                int pos = 0;
-
-                for ( char c : ( ( String ) compared ).toCharArray() )
-                {
-                    switch ( state )
-                    {
-                        case 1:
-                            if ( c != '\\' )
-                            {
-                                return null;
-                            }
-
-                            state++;
-                            break;
-
-                        case 2:
-                            int high = StringTools.getHexValue( c );
-
-                            if ( high == -1 )
-                            {
-                                return null;
-                            }
-
-                            comparedBytes[pos] = ( byte ) ( high << 4 );
-
-                            state++;
-                            break;
-
-                        case 3:
-                            int low = StringTools.getHexValue( c );
-
-                            if ( low == -1 )
-                            {
-                                return null;
-                            }
-
-                            comparedBytes[pos] += ( byte ) low;
-                            pos++;
-
-                            state = 1;
-                            break;
-                    }
-                }
-            }
-            else
-            {
-                comparedBytes = ( byte[] ) compared;
-            }
-
-            for ( NamingEnumeration<?> values = attr.getAll(); values.hasMoreElements(); )
-            {
-                Object value = values.nextElement();
-
-                if ( value instanceof byte[] )
-                {
-                    if ( ArrayUtils.isEquals( comparedBytes, value ) )
-                    {
-                        return attr.remove( value );
-                    }
-                }
-            }
-        }
-
-        return null;
-    }
-    */
-
     /**
      * Convert a BasicAttributes or a AttributesImpl to a ServerEntry
      *

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AttributeUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java Sat Jan 22 22:37:04 2011
@@ -32,7 +32,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
@@ -40,8 +40,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.RdnSerializer;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.util.UTFUtils;
 import org.apache.directory.shared.util.Strings;
+import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -2646,7 +2646,7 @@ public class DefaultEntry implements Ent
                 // the attribute
                 String oid = attributeType.getOid();
 
-                UTFUtils.writeUTF( out, oid );
+                Unicode.writeUTF(out, oid);
 
                 // Get the attribute
                 DefaultEntryAttribute attribute = ( DefaultEntryAttribute ) attributes.get( attributeType.getOid() );
@@ -2662,7 +2662,7 @@ public class DefaultEntry implements Ent
             {
                 // Write the id to be able to restore the AttributeType when deserializing
                 // the attribute
-                UTFUtils.writeUTF( out, id );
+                Unicode.writeUTF(out, id);
 
                 // Get the attribute
                 DefaultEntryAttribute attribute = ( DefaultEntryAttribute ) attributes.get( id );
@@ -2703,7 +2703,7 @@ public class DefaultEntry implements Ent
             for ( int i = 0; i < nbAttributes; i++ )
             {
                 // Read the attribute's OID
-                String oid = UTFUtils.readUTF( in );
+                String oid = Unicode.readUTF(in);
 
                 try
                 {
@@ -2731,7 +2731,7 @@ public class DefaultEntry implements Ent
             for ( int i = 0; i < nbAttributes; i++ )
             {
                 // Read the attribute's ID
-                String id = UTFUtils.readUTF( in );
+                String id = Unicode.readUTF(in);
 
                 // Create the attribute we will read
                 EntryAttribute attribute = new DefaultEntryAttribute( id );

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=1062285&r1=1062284&r2=1062285&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 22:37:04 2011
@@ -33,8 +33,8 @@ 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.UTFUtils;
 import org.apache.directory.shared.util.Strings;
+import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -2409,7 +2409,7 @@ public class DefaultEntryAttribute imple
     public void serialize( ObjectOutput out ) throws IOException
     {
         // Write the UPId (the id will be deduced from the upID)
-        UTFUtils.writeUTF( out, upId );
+        Unicode.writeUTF(out, upId);
         
         // Write the HR flag, if not null
         if ( isHR != null )
@@ -2452,7 +2452,7 @@ public class DefaultEntryAttribute imple
     public void deserialize( ObjectInput in ) throws IOException, ClassNotFoundException
     {
         // Read the ID and the UPId
-        upId = UTFUtils.readUTF( in );
+        upId = Unicode.readUTF(in);
         
         // Compute the id
         setUpId( upId );
@@ -2509,7 +2509,7 @@ public class DefaultEntryAttribute imple
     public void writeExternal( ObjectOutput out ) throws IOException
     {
         // Write the UPId (the id will be deduced from the upID)
-        UTFUtils.writeUTF( out, upId );
+        Unicode.writeUTF(out, upId);
         
         // Write the HR flag, if not null
         if ( isHR != null )
@@ -2545,7 +2545,7 @@ public class DefaultEntryAttribute imple
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
         // Read the ID and the UPId
-        upId = UTFUtils.readUTF( in );
+        upId = Unicode.readUTF(in);
         
         // Compute the id
         setUpId( upId );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultModification.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultModification.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultModification.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultModification.java Sat Jan 22 22:37:04 2011
@@ -27,7 +27,7 @@ import org.apache.directory.shared.i18n.
 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.UTFUtils;
+import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -243,7 +243,7 @@ public class DefaultModification impleme
         AttributeType at = attribute.getAttributeType();
         
         // Write the attribute's oid
-        UTFUtils.writeUTF( out, at.getOid() );
+        Unicode.writeUTF(out, at.getOid());
         
         // Write the attribute
         ((DefaultEntryAttribute)attribute).serialize( out );
@@ -267,7 +267,7 @@ public class DefaultModification impleme
         operation = ModificationOperation.getOperation( op );
         
         // Read the attribute OID
-        String oid = UTFUtils.readUTF( in );
+        String oid = Unicode.readUTF(in);
         
         // Lookup for tha associated AttributeType
         AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java Sat Jan 22 22:37:04 2011
@@ -26,7 +26,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;

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=1062285&r1=1062284&r2=1062285&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 22:37:04 2011
@@ -24,13 +24,13 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.exception.LdapException;
 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.UTFUtils;
 import org.apache.directory.shared.util.Strings;
+import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -487,7 +487,7 @@ public class StringValue extends Abstrac
         // Read the wrapped value, if it's not null
         if ( in.readBoolean() )
         {
-            wrappedValue = UTFUtils.readUTF( in );
+            wrappedValue = Unicode.readUTF(in);
         }
         
         // Read the isNormalized flag
@@ -496,7 +496,7 @@ public class StringValue extends Abstrac
         if ( ( normalized ) && ( in.readBoolean() ) )
         {
             // Read the normalized value, if not null
-            normalizedValue = UTFUtils.readUTF( in );
+            normalizedValue = Unicode.readUTF(in);
         }
         
         h = 0;
@@ -512,7 +512,7 @@ public class StringValue extends Abstrac
         if ( wrappedValue != null )
         {
             out.writeBoolean( true );
-            UTFUtils.writeUTF( out, wrappedValue );
+            Unicode.writeUTF(out, wrappedValue);
         }
         else
         {
@@ -528,7 +528,7 @@ public class StringValue extends Abstrac
             if ( normalizedValue != null )
             {
                 out.writeBoolean( true );
-                UTFUtils.writeUTF( out, normalizedValue );
+                Unicode.writeUTF(out, normalizedValue);
             }
             else
             {
@@ -570,7 +570,7 @@ public class StringValue extends Abstrac
             out.writeBoolean( true );
             
             // Write the data
-            UTFUtils.writeUTF( out, wrappedValue );
+            Unicode.writeUTF(out, wrappedValue);
             
             // Normalize the data
             try
@@ -585,7 +585,7 @@ public class StringValue extends Abstrac
                 else
                 {
                     out.writeBoolean( false );
-                    UTFUtils.writeUTF( out,  normalizedValue );
+                    Unicode.writeUTF(out, normalizedValue);
                 }
             }
             catch ( LdapException ne )
@@ -624,7 +624,7 @@ public class StringValue extends Abstrac
         }
         
         // Read the value
-        String wrapped = UTFUtils.readUTF( in );
+        String wrapped = Unicode.readUTF(in);
         
         wrappedValue = wrapped;
         
@@ -643,7 +643,7 @@ public class StringValue extends Abstrac
             else
             {
                 // The normalized value is different. Read it
-                normalizedValue = UTFUtils.readUTF( in );
+                normalizedValue = Unicode.readUTF(in);
             }
         }
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java Sat Jan 22 22:37:04 2011
@@ -25,7 +25,7 @@ import java.util.Hashtable;
 import javax.naming.Context;
 import javax.naming.NamingException;
 
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java Sat Jan 22 22:37:04 2011
@@ -28,7 +28,7 @@ import java.util.List;
 import javax.naming.Context;
 import javax.naming.NamingException;
 
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapURLEncodingException.java (from r1062128, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURLEncodingException.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapURLEncodingException.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapURLEncodingException.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURLEncodingException.java&r1=1062128&r2=1062285&rev=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURLEncodingException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapURLEncodingException.java Sat Jan 22 22:37:04 2011
@@ -17,8 +17,7 @@
  *  under the License. 
  *  
  */
-
-package org.apache.directory.shared.ldap.codec.util;
+package org.apache.directory.shared.ldap.exception;
 
 
 /**
@@ -27,26 +26,14 @@ package org.apache.directory.shared.ldap
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapURLEncodingException extends Exception
+public class LdapURLEncodingException extends LdapException
 {
-
-    /**
-     * Declares the Serial Version Uid.
-     * 
-     * @see <a
-     *      href="http://c2.com/cgi/wiki?AlwaysDeclareSerialVersionUid">Always
-     *      Declare Serial Version Uid</a>
-     */
-    private static final long serialVersionUID = 1L;
-
-
     /**
      * Creates a LdapStringEncodingException
      * 
-     * @param pMessage
-     *            A message with meaning to a human
+     * @param pMessage A message with meaning to a human
      */
-    public LdapURLEncodingException(String pMessage)
+    public LdapURLEncodingException( String pMessage )
     {
         super( pMessage );
     }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapURLEncodingException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapUriException.java (from r1062128, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/URIException.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapUriException.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapUriException.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/URIException.java&r1=1062128&r2=1062285&rev=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/URIException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapUriException.java Sat Jan 22 22:37:04 2011
@@ -17,8 +17,7 @@
  *  under the License. 
  *  
  */
-
-package org.apache.directory.shared.ldap.codec.util;
+package org.apache.directory.shared.ldap.exception;
 
 
 /**
@@ -26,7 +25,7 @@ package org.apache.directory.shared.ldap
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class URIException extends Exception
+public class LdapUriException extends LdapException
 {
     private static final long serialVersionUID = 1L;
 
@@ -38,7 +37,7 @@ public class URIException extends Except
      * @param reason
      *            the reason
      */
-    public URIException(String reason)
+    public LdapUriException(String reason)
     {
         super( reason ); // for backward compatibility of Throwable
         this.reason = reason;

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapUriException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/UrlDecoderException.java (from r1062128, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/UrlDecoderException.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/UrlDecoderException.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/UrlDecoderException.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/UrlDecoderException.java&r1=1062128&r2=1062285&rev=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/UrlDecoderException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/UrlDecoderException.java Sat Jan 22 22:37:04 2011
@@ -18,15 +18,17 @@
  *  
  */
 
-package org.apache.directory.shared.ldap.codec.util;
+package org.apache.directory.shared.ldap.exception;
 
 
+import org.apache.directory.shared.ldap.exception.LdapException;
+
 /**
  * Thrown when a Decoder has encountered a failure condition during a decode.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class UrlDecoderException extends Exception
+public class UrlDecoderException extends LdapException
 {
     private static final long serialVersionUID = 1L;
 

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/UrlDecoderException.java
------------------------------------------------------------------------------
    svn:eol-style = native

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=1062285&r1=1062284&r2=1062285&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 22:37:04 2011
@@ -23,12 +23,12 @@ package org.apache.directory.shared.ldap
 import java.text.ParseException;
 
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.entry.AttributeUtils;
 import org.apache.directory.shared.ldap.entry.BinaryValue;
 import org.apache.directory.shared.ldap.entry.Value;
 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.AttributeUtils;
 import org.apache.directory.shared.util.*;
 
 
@@ -170,7 +170,7 @@ public class FilterParser
                 }
                 else
                 {
-                    AttributeUtils.parseAttribute( filter, pos, false );
+                    AttributeUtils.parseAttribute(filter, pos, false);
 
                     node.setMatchingRuleId( filter.substring( start, pos.start ) );
 

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LdapURL.java (from r1062251, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LdapURL.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LdapURL.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java&r1=1062251&r2=1062285&rev=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LdapURL.java Sat Jan 22 22:37:04 2011
@@ -17,12 +17,11 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.shared.ldap.util;
+package org.apache.directory.shared.ldap.filter;
 
 
 import java.io.ByteArrayOutputStream;
 import java.io.UnsupportedEncodingException;
-import java.net.URI;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -31,13 +30,10 @@ import java.util.Set;
 
 import org.apache.directory.shared.asn1.Hex;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.codec.util.HttpClientError;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.codec.util.URIException;
-import org.apache.directory.shared.ldap.codec.util.UrlDecoderException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-import org.apache.directory.shared.ldap.filter.FilterParser;
-import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.exception.LdapUriException;
+import org.apache.directory.shared.ldap.exception.UrlDecoderException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.util.Chars;
 import org.apache.directory.shared.util.StringConstants;
@@ -142,7 +138,7 @@ public class LdapURL
     /**
      * Parse a LdapURL
      * @param chars The chars containing the URL
-     * @throws LdapURLEncodingException If the URL is invalid
+     * @throws org.apache.directory.shared.ldap.exception.LdapURLEncodingException If the URL is invalid
      */
     public void parse( char[] chars ) throws LdapURLEncodingException
     {
@@ -650,9 +646,9 @@ public class LdapURL
      * 
      * @param data the string to be encoded
      * @return The string as a byte array.
-     * @since 3.0
+     * @throws UrlDecoderException if encoding is not supported
      */
-    public static byte[] getAsciiBytes( final String data )
+    public static byte[] getAsciiBytes( final String data ) throws UrlDecoderException
     {
 
         if ( data == null )
@@ -666,8 +662,7 @@ public class LdapURL
         }
         catch ( UnsupportedEncodingException e )
         {
-            // TODO: Why do we throw a HttpClientError here?
-            throw new HttpClientError( I18n.err( I18n.ERR_04413 ) );
+            throw new UrlDecoderException( I18n.err( I18n.ERR_04413 ) );
         }
     }
 
@@ -729,10 +724,9 @@ public class LdapURL
      * 
      * @param escaped a string
      * @return the unescaped string
-     * @throws URIException if the string cannot be decoded (invalid)
-     * @see URI#getDefaultProtocolCharset
+     * @throws LdapUriException if the string cannot be decoded (invalid)
      */
-    private static String decode( String escaped ) throws URIException
+    private static String decode( String escaped ) throws LdapUriException
     {
         try
         {
@@ -741,7 +735,7 @@ public class LdapURL
         }
         catch ( UrlDecoderException e )
         {
-            throw new URIException( e.getMessage() );
+            throw new LdapUriException( e.getMessage() );
         }
     }
 
@@ -768,7 +762,7 @@ public class LdapURL
         {
             dn = new DN( decode( new String( chars, pos, end - pos ) ) );
         }
-        catch ( URIException ue )
+        catch ( LdapUriException ue )
         {
             return -1;
         }
@@ -882,7 +876,7 @@ public class LdapURL
 
             return end;
         }
-        catch ( URIException ue )
+        catch ( LdapUriException ue )
         {
             return -1;
         }
@@ -917,7 +911,7 @@ public class LdapURL
             filter = decode( new String( chars, pos, end - pos ) );
             FilterParser.parse( null, filter );
         }
-        catch ( URIException ue )
+        catch ( LdapUriException ue )
         {
             return -1;
         }
@@ -1128,7 +1122,7 @@ public class LdapURL
 
             return chars.length;
         }
-        catch ( URIException ue )
+        catch ( LdapUriException ue )
         {
             return -1;
         }
@@ -1549,8 +1543,8 @@ public class LdapURL
 
 
     /**
-     * Returns the scope, one of {@link SearchScope.OBJECT}, 
-     * {@link SearchScope.ONELEVEL} or {@link SearchScope.SUBTREE}.
+     * Returns the scope, one of {@link SearchScope#OBJECT},
+     * {@link SearchScope#ONELEVEL} or {@link SearchScope#SUBTREE}.
      * 
      * @return Returns the scope.
      */
@@ -1726,9 +1720,9 @@ public class LdapURL
 
 
     /**
-     * Sets the scope. Must be one of {@link SearchScope.OBJECT}, 
-     * {@link SearchScope.ONELEVEL} or {@link SearchScope.SUBTREE},
-     * otherwise {@link SearchScope.OBJECT} is assumed as default.
+     * Sets the scope. Must be one of {@link SearchScope#OBJECT},
+     * {@link SearchScope#ONELEVEL} or {@link SearchScope#SUBTREE},
+     * otherwise {@link SearchScope#OBJECT} is assumed as default.
      * 
      * @param scope the new scope
      */
@@ -1746,9 +1740,9 @@ public class LdapURL
 
 
     /**
-     * Sets the scope. Must be one of {@link SearchScope.OBJECT}, 
-     * {@link SearchScope.ONELEVEL} or {@link SearchScope.SUBTREE},
-     * otherwise {@link SearchScope.OBJECT} is assumed as default.
+     * Sets the scope. Must be one of {@link SearchScope#OBJECT},
+     * {@link SearchScope#ONELEVEL} or {@link SearchScope#SUBTREE},
+     * otherwise {@link SearchScope#OBJECT} is assumed as default.
      * 
      * @param scope the new scope
      */

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/LdapURL.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java Sat Jan 22 22:37:04 2011
@@ -23,12 +23,12 @@ package org.apache.directory.shared.ldap
 import java.util.ArrayList;
 import java.util.List;
 import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
 
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.Normalizer;
-import org.apache.directory.shared.ldap.util.StringTools;
 
 
 /**
@@ -150,7 +150,52 @@ public class SubstringNode extends LeafN
         this.initialPattern = initialPattern;
     }
 
-    
+    /**
+     * Creates a regular expression from an LDAP substring assertion filter
+     * specification.
+     *
+     * @param initialPattern
+     *            the initial fragment before wildcards
+     * @param anyPattern
+     *            fragments surrounded by wildcards if any
+     * @param finalPattern
+     *            the final fragment after last wildcard if any
+     * @return the regular expression for the substring match filter
+     * @throws java.util.regex.PatternSyntaxException
+     *             if a syntactically correct regular expression cannot be
+     *             compiled
+     */
+    public static Pattern getRegex( String initialPattern, String[] anyPattern, String finalPattern )
+            throws PatternSyntaxException
+    {
+        StringBuffer buf = new StringBuffer();
+
+        if ( initialPattern != null )
+        {
+            buf.append( '^' ).append( Pattern.quote( initialPattern ) );
+        }
+
+        if ( anyPattern != null )
+        {
+            for ( int i = 0; i < anyPattern.length; i++ )
+            {
+                buf.append( ".*" ).append( Pattern.quote( anyPattern[i] ) );
+            }
+        }
+
+        if ( finalPattern != null )
+        {
+            buf.append( ".*" ).append( Pattern.quote( finalPattern ) );
+        }
+        else
+        {
+            buf.append( ".*" );
+        }
+
+        return Pattern.compile(buf.toString());
+    }
+
+
     /**
      * Clone the Node
      */
@@ -282,7 +327,7 @@ public class SubstringNode extends LeafN
                 finalStr = ( String ) normalizer.normalize( finalPattern );
             }
 
-            return StringTools.getRegex( initialStr, any, finalStr );
+            return getRegex(initialStr, any, finalStr);
         }
 
         String initialStr = null;
@@ -299,7 +344,7 @@ public class SubstringNode extends LeafN
             finalStr = ( String ) normalizer.normalize( finalPattern );
         }
 
-        return StringTools.getRegex( initialStr, null, finalStr );
+        return getRegex(initialStr, null, finalStr);
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java Sat Jan 22 22:37:04 2011
@@ -46,7 +46,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
-import org.apache.directory.shared.ldap.util.UTFUtils;
+import org.apache.directory.shared.util.Unicode;
 
 
 /**
@@ -991,12 +991,12 @@ public class LdifEntry implements Clonea
 
                 if ( in.readBoolean() )
                 {
-                    newRdn = UTFUtils.readUTF( in );
+                    newRdn = Unicode.readUTF(in);
                 }
 
                 if ( in.readBoolean() )
                 {
-                    newSuperior = UTFUtils.readUTF( in );
+                    newSuperior = Unicode.readUTF(in);
                 }
 
                 break;
@@ -1008,7 +1008,7 @@ public class LdifEntry implements Clonea
                 for ( int i = 0; i < nbModifs; i++ )
                 {
                     int operation = in.readInt();
-                    String modStr = UTFUtils.readUTF( in );
+                    String modStr = Unicode.readUTF(in);
                     DefaultEntryAttribute value = ( DefaultEntryAttribute ) in.readObject();
 
                     addModificationItem( ModificationOperation.getOperation( operation ), modStr, value );
@@ -1090,7 +1090,7 @@ public class LdifEntry implements Clonea
                 if ( newRdn != null )
                 {
                     out.writeBoolean( true );
-                    UTFUtils.writeUTF( out, newRdn );
+                    Unicode.writeUTF(out, newRdn);
                 }
                 else
                 {
@@ -1100,7 +1100,7 @@ public class LdifEntry implements Clonea
                 if ( newSuperior != null )
                 {
                     out.writeBoolean( true );
-                    UTFUtils.writeUTF( out, newSuperior );
+                    Unicode.writeUTF(out, newSuperior);
                 }
                 else
                 {
@@ -1115,7 +1115,7 @@ public class LdifEntry implements Clonea
                 for ( Modification modification : modificationList )
                 {
                     out.writeInt( modification.getOperation().getValue() );
-                    UTFUtils.writeUTF( out, modification.getAttribute().getId() );
+                    Unicode.writeUTF(out, modification.getAttribute().getId());
 
                     EntryAttribute attribute = modification.getAttribute();
                     out.writeObject( attribute );
@@ -1136,7 +1136,7 @@ public class LdifEntry implements Clonea
 
             for ( Control control : controls.values() )
             {
-                UTFUtils.writeUTF( out, control.getOid() );
+                Unicode.writeUTF(out, control.getOid());
                 out.writeBoolean( control.isCritical() );
                 out.writeBoolean( control.hasValue() );
 

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=1062285&r1=1062284&r2=1062285&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 22:37:04 2011
@@ -43,7 +43,7 @@ import java.util.NoSuchElementException;
 
 import org.apache.directory.shared.asn1.util.OID;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java Sat Jan 22 22:37:04 2011
@@ -26,18 +26,13 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
-import org.apache.directory.shared.ldap.entry.DefaultModification;
-import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.entry.Modification;
-import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.entry.*;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.AVA;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
+import org.apache.directory.shared.ldap.entry.AttributeUtils;
 
 
 /**
@@ -230,7 +225,7 @@ public final class LdifRevertor
 
             }
 
-            AttributeUtils.applyModification( clonedEntry, modification );
+            AttributeUtils.applyModification(clonedEntry, modification);
 
         }
 

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=1062285&r1=1062284&r2=1062285&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 22:37:04 2011
@@ -25,18 +25,14 @@ import java.io.UnsupportedEncodingExcept
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
-import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.entry.Modification;
-import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.*;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
 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.entry.AttributeUtils;
 import org.apache.directory.shared.util.Base64;
 import org.apache.directory.shared.util.Strings;
 
@@ -180,7 +176,7 @@ public final class LdifUtils
      */
     public static String convertToLdif( Attributes attrs, int length ) throws LdapException
     {
-        return convertAttributesToLdif( AttributeUtils.toClientEntry( attrs, null ), length );
+        return convertAttributesToLdif( AttributeUtils.toClientEntry(attrs, null), length );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java Sat Jan 22 22:37:04 2011
@@ -21,7 +21,7 @@
 package org.apache.directory.shared.ldap.message;
 
 
-import org.apache.directory.shared.ldap.RuntimeMultiException;
+import org.apache.directory.shared.util.exception.RuntimeMultiException;
 
 
 /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResponseCarryingMessageException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResponseCarryingMessageException.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResponseCarryingMessageException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResponseCarryingMessageException.java Sat Jan 22 22:37:04 2011
@@ -21,7 +21,7 @@
 package org.apache.directory.shared.ldap.message;
 
 
-import org.apache.directory.shared.ldap.RuntimeMultiException;
+import org.apache.directory.shared.util.exception.RuntimeMultiException;
 
 
 /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java?rev=1062285&r1=1062284&r2=1062285&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulDisconnect.java Sat Jan 22 22:37:04 2011
@@ -29,12 +29,12 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.extended.operations.gracefulDisconnect.GracefulDisconnectContainer;
 import org.apache.directory.shared.ldap.codec.extended.operations.gracefulDisconnect.GracefulDisconnectDecoder;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.filter.LdapURL;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

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=1062285&r1=1062284&r2=1062285&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 22:37:04 2011
@@ -27,7 +27,7 @@ import javax.naming.ldap.ExtendedRespons
 
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedure;
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedureContainer;
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedureDecoder;

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=1062285&r1=1062284&r2=1062285&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 22:37:04 2011
@@ -32,8 +32,8 @@ 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.UTFUtils;
 import org.apache.directory.shared.util.Strings;
+import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -788,11 +788,11 @@ public class AVA implements Cloneable, C
             throw new IOException( message );
         }
         
-        UTFUtils.writeUTF( out, upName );
+        Unicode.writeUTF(out, upName);
         out.writeInt( start );
         out.writeInt( length );
-        UTFUtils.writeUTF( out, upType );
-        UTFUtils.writeUTF( out, normType );
+        Unicode.writeUTF(out, upType);
+        Unicode.writeUTF(out, normType);
         
         boolean isHR = !normValue.isBinary();
         
@@ -800,8 +800,8 @@ public class AVA implements Cloneable, C
         
         if ( isHR )
         {
-            UTFUtils.writeUTF( out, upValue.getString() );
-            UTFUtils.writeUTF( out, normValue.getString() );
+            Unicode.writeUTF(out, upValue.getString());
+            Unicode.writeUTF(out, normValue.getString());
         }
         else
         {
@@ -822,18 +822,18 @@ public class AVA implements Cloneable, C
      */
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
-        upName = UTFUtils.readUTF( in );
+        upName = Unicode.readUTF(in);
         start = in.readInt();
         length = in.readInt();
-        upType = UTFUtils.readUTF( in );
-        normType = UTFUtils.readUTF( in );
+        upType = Unicode.readUTF(in);
+        normType = Unicode.readUTF(in);
         
         boolean isHR = in.readBoolean();
         
         if ( isHR )
         {
-            upValue = new StringValue( UTFUtils.readUTF( in ) );
-            normValue = new StringValue( UTFUtils.readUTF( in ) );
+            upValue = new StringValue( Unicode.readUTF(in) );
+            normValue = new StringValue( Unicode.readUTF(in) );
         }
         else
         {