directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r328681 - in /directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder: delete/ extended/ modify/ modifydn/
Date Wed, 26 Oct 2005 17:09:09 GMT
Author: elecharny
Date: Wed Oct 26 10:08:53 2005
New Revision: 328681

URL: http://svn.apache.org/viewcvs?rev=328681&view=rev
Log:
Moified the new String( octets ) to handle utf-8 strings

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/delete/DeleteRequestRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestOidRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestPayloadRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponseOidRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponsePayloadRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModificationItemRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestAttributeValueRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestEntryDnRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestEntryRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewRdnRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewSuperiorRule.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/delete/DeleteRequestRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/delete/DeleteRequestRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/delete/DeleteRequestRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/delete/DeleteRequestRule.java
Wed Oct 26 10:08:53 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.BufferUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 import org.apache.ldap.common.message.DeleteRequest;
@@ -66,7 +67,7 @@
         super.finish() ;
 
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
-        String name = new String( BufferUtils.getArray( buf ) ) ;
+        String name = StringUtils.toUtf8( BufferUtils.getArray( buf ) );
         DeleteRequest req = ( DeleteRequest ) getDigester().pop() ;
         req.setName( name ) ;
     }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestOidRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestOidRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestOidRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestOidRule.java
Wed Oct 26 10:08:53 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 import org.apache.ldap.common.message.ExtendedRequest;
 
@@ -63,6 +64,7 @@
         ExtendedRequest req = ( ExtendedRequest ) getDigester().peek() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -75,6 +77,6 @@
             buf.get( octets ) ;
         }
 
-        req.setOid( new String( octets ) ) ;
+        req.setOid( StringUtils.toUtf8( octets ) ) ;
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestPayloadRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestPayloadRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestPayloadRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedRequestPayloadRule.java
Wed Oct 26 10:08:53 2005
@@ -64,6 +64,7 @@
         ExtendedRequest req = ( ExtendedRequest ) getDigester().peek() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponseOidRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponseOidRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponseOidRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponseOidRule.java
Wed Oct 26 10:08:53 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 import org.apache.ldap.common.message.ExtendedResponse;
 
@@ -63,6 +64,7 @@
         ExtendedResponse resp = ( ExtendedResponse ) getDigester().peek() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -75,6 +77,6 @@
             buf.get( octets ) ;
         }
 
-        resp.setResponseName( new String( octets ) ) ;
+        resp.setResponseName( StringUtils.toUtf8( octets ) ) ;
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponsePayloadRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponsePayloadRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponsePayloadRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/extended/ExtendedResponsePayloadRule.java
Wed Oct 26 10:08:53 2005
@@ -64,6 +64,7 @@
         ExtendedResponse resp = ( ExtendedResponse ) getDigester().peek() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModificationItemRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModificationItemRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModificationItemRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModificationItemRule.java
Wed Oct 26 10:08:53 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
 import org.apache.asn1.ber.primitives.UniversalTag;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.LockableAttributeImpl;
 import org.apache.ldap.common.message.ModifyRequest;
 
@@ -41,7 +42,6 @@
         super( UniversalTag.OCTET_STRING ) ;
     }
 
-
     /**
      * Allows the super method to push a ByteBuffer onto the top of the stack
      * which contains the drained contents of the superclass' ByteAccumulator.
@@ -66,6 +66,7 @@
         ByteBuffer buf = ( ByteBuffer ) getAccumulator().drain( 0 ) ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -87,12 +88,15 @@
             case( 0 ):
                 modCode = DirContext.ADD_ATTRIBUTE ;
                 break ;
+                
             case( 1 ):
                 modCode = DirContext.REMOVE_ATTRIBUTE ;
                 break ;
+                
             case( 2 ):
                 modCode = DirContext.REPLACE_ATTRIBUTE ;
                 break ;
+                
             default:
                 throw new IllegalStateException(
                     "Expecting 0, 1, 2 int value for add, delete, or replace"
@@ -100,7 +104,7 @@
         }
 
         LockableAttributeImpl attr =
-                new LockableAttributeImpl( new String( octets ) ) ;
+                new LockableAttributeImpl( StringUtils.toUtf8( octets ) ) ;
         ModifyRequest req = ( ModifyRequest ) getDigester().peek() ;
         ModificationItem mods = new ModificationItem( modCode, attr ) ;
         req.addModification( mods ) ;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestAttributeValueRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestAttributeValueRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestAttributeValueRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestAttributeValueRule.java
Wed Oct 26 10:08:53 2005
@@ -66,6 +66,7 @@
         ModificationItem mods = ( ModificationItem ) getDigester().peek() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -79,7 +80,7 @@
         }
 
         // Add the attribute
-        mods.getAttribute().add( new String( octets ) ) ;
+        mods.getAttribute().add( octets ) ;
 
         // clean up
         setConstructed( false ) ;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestEntryDnRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestEntryDnRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestEntryDnRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modify/ModifyRequestEntryDnRule.java
Wed Oct 26 10:08:53 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
 import org.apache.asn1.ber.primitives.UniversalTag;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.ModifyRequest;
 
 import java.nio.ByteBuffer;
@@ -63,6 +64,7 @@
         ModifyRequest req = ( ModifyRequest ) getDigester().peek() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -75,6 +77,6 @@
             buf.get( octets ) ;
         }
 
-        req.setName( new String( octets ) ) ;
+        req.setName( StringUtils.toUtf8( octets ) ) ;
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestEntryRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestEntryRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestEntryRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestEntryRule.java
Wed Oct 26 10:08:53 2005
@@ -20,6 +20,7 @@
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
 import org.apache.asn1.ber.primitives.UniversalTag;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.ModifyDnRequest;
 
 import java.nio.ByteBuffer;
@@ -118,6 +119,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -130,7 +132,7 @@
             buf.get( octets ) ;
         }
 
-        req.setName( new String( octets ) ) ;
+        req.setName( StringUtils.toUtf8( octets ) ) ;
         byPass = false ;
         req = null ;
     }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewRdnRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewRdnRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewRdnRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewRdnRule.java
Wed Oct 26 10:08:53 2005
@@ -20,6 +20,7 @@
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
 import org.apache.asn1.ber.primitives.UniversalTag;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.ModifyDnRequest;
 
 import java.nio.ByteBuffer;
@@ -121,6 +122,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -133,7 +135,7 @@
             buf.get( octets ) ;
         }
 
-        req.setNewRdn( new String( octets ) ) ;
+        req.setNewRdn( StringUtils.toUtf8( octets ) ) ;
         byPass = false ;
         req = null ;
     }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewSuperiorRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewSuperiorRule.java?rev=328681&r1=328680&r2=328681&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewSuperiorRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/modifydn/ModifyDnRequestNewSuperiorRule.java
Wed Oct 26 10:08:53 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 import org.apache.ldap.common.message.ModifyDnRequest;
 
@@ -78,6 +79,7 @@
         ModifyDnRequest req = ( ModifyDnRequest ) getDigester().peek() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -90,6 +92,6 @@
             buf.get( octets ) ;
         }
 
-        req.setNewSuperior( new String( octets ) ) ;
+        req.setNewSuperior( StringUtils.toUtf8( octets ) ) ;
     }
 }



Mime
View raw message