directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r328724 - in /directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder: ErrorMessageRule.java ReferralUrlRule.java ResultMatchedDNRule.java ResultRule.java
Date Wed, 26 Oct 2005 20:33:45 GMT
Author: elecharny
Date: Wed Oct 26 13:33:38 2005
New Revision: 328724

URL: http://svn.apache.org/viewcvs?rev=328724&view=rev
Log:
Modified the rules to handle utf-8 strings

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ErrorMessageRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ReferralUrlRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ResultMatchedDNRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ResultRule.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ErrorMessageRule.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/ErrorMessageRule.java?rev=328724&r1=328723&r2=328724&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ErrorMessageRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ErrorMessageRule.java
Wed Oct 26 13:33:38 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.message.LdapResult;
 import org.apache.ldap.common.message.ResultResponse;
@@ -103,7 +104,7 @@
         }
 
         ByteBuffer buf = getAccumulator().drain( 0 ) ;
-        String errorMsg = new String( BufferUtils.getArray( buf ) ) ;
+        String errorMsg = StringUtils.toUtf8( BufferUtils.getArray( buf ) ) ;
         result.setErrorMessage( errorMsg ) ;
 
         // clean up

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ReferralUrlRule.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/ReferralUrlRule.java?rev=328724&r1=328723&r2=328724&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ReferralUrlRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ReferralUrlRule.java
Wed Oct 26 13:33:38 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.Referral;
 
 import java.nio.ByteBuffer;
@@ -46,6 +47,7 @@
         Referral ref = ( Referral ) getDigester().peek() ;
 
         byte[] url = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -58,6 +60,6 @@
             buf.get( url ) ;
         }
 
-        ref.addLdapUrl( new String( url ) ) ;
+        ref.addLdapUrl( StringUtils.toUtf8( url ) ) ;
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ResultMatchedDNRule.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/ResultMatchedDNRule.java?rev=328724&r1=328723&r2=328724&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ResultMatchedDNRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ResultMatchedDNRule.java
Wed Oct 26 13:33:38 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.message.LdapResult;
 import org.apache.ldap.common.message.ResultResponse;
@@ -39,6 +40,7 @@
 {
     /** the result carried by the result containing response */
     private LdapResult result = null ;
+    
     /** whether or not to process this rule firing */
     private boolean byPass = false ;
 
@@ -96,8 +98,8 @@
         }
 
         ByteBuffer buf = getAccumulator().drain( 0 ) ;
-        String dn = new String( BufferUtils.getArray( buf ) ) ;
-        result.setMatchedDn( dn ); ;
+        String dn = StringUtils.toUtf8( BufferUtils.getArray( buf ) ) ;
+        result.setMatchedDn( dn );
 
         // clean up
         setConstructed( false ) ;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ResultRule.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/ResultRule.java?rev=328724&r1=328723&r2=328724&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ResultRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/ResultRule.java
Wed Oct 26 13:33:38 2005
@@ -18,6 +18,7 @@
 
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.AbstractRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.BufferUtils;
 import org.apache.ldap.common.message.LdapResult;
 import org.apache.ldap.common.message.LdapResultImpl;
@@ -59,9 +60,9 @@
         super.finish() ;
 
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
-        result.setErrorMessage( new String( BufferUtils.getArray( buf ) ) ) ;
+        result.setErrorMessage( StringUtils.toUtf8( BufferUtils.getArray( buf ) ) ) ;
         buf = ( ByteBuffer ) getDigester().pop() ;
-        result.setMatchedDn( new String( BufferUtils.getArray( buf ) ) ) ;
+        result.setMatchedDn( StringUtils.toUtf8( BufferUtils.getArray( buf ) ) ) ;
         int resultCode = getDigester().popInt() ;
         result.setResultCode( ResultCodeEnum.getResultCodeEnum( resultCode ) ) ;
         getDigester().pop() ;



Mime
View raw message