From commits-return-29364-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Mon Dec 20 14:32:07 2010 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 12407 invoked from network); 20 Dec 2010 14:32:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Dec 2010 14:32:06 -0000 Received: (qmail 92380 invoked by uid 500); 20 Dec 2010 14:32:06 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 92239 invoked by uid 500); 20 Dec 2010 14:32:05 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 92157 invoked by uid 99); 20 Dec 2010 14:32:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Dec 2010 14:32:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Dec 2010 14:32:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 33B8B2388ACC; Mon, 20 Dec 2010 14:31:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1051130 [5/7] - in /directory: apacheds/branches/alex_refactoring/core-api/src/main/java/org/apache/directory/server/core/ apacheds/branches/alex_refactoring/core-api/src/main/java/org/apache/directory/server/core/entry/ apacheds/branches/... Date: Mon, 20 Dec 2010 14:31:36 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101220143141.33B8B2388ACC@eris.apache.org> Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java Mon Dec 20 14:31:29 2010 @@ -24,7 +24,6 @@ import java.util.Arrays; import org.apache.directory.shared.i18n.I18n; import org.apache.directory.shared.ldap.name.DN; -import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.util.Strings; @@ -156,7 +155,7 @@ public class BindRequestImpl extends Abs */ public void setCredentials( String credentials ) { - setCredentials( StringTools.getBytesUtf8( credentials ) ); + setCredentials( Strings.getBytesUtf8(credentials) ); } @@ -493,7 +492,7 @@ public class BindRequestImpl extends Abs sb.append( " BindRequest\n" ); sb.append( " Version : '" ).append( isVersion3 ? "3" : "2" ).append( "'\n" ); - if ( StringTools.isEmpty( name.getNormName() ) && isSimple ) + if ( Strings.isEmpty(name.getNormName()) && isSimple ) { sb.append( " Name : anonymous\n" ); } @@ -503,7 +502,7 @@ public class BindRequestImpl extends Abs if ( isSimple ) { - sb.append( " Simple authentication : '" ).append( StringTools.utf8ToString( credentials ) ) + sb.append( " Simple authentication : '" ).append( Strings.utf8ToString(credentials) ) .append( '/' ).append( Strings.dumpBytes(credentials) ).append( "'\n" ); } else Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java Mon Dec 20 14:31:29 2010 @@ -24,7 +24,6 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.entry.StringValue; import org.apache.directory.shared.ldap.entry.Value; import org.apache.directory.shared.ldap.name.DN; -import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.util.Strings; @@ -415,7 +414,7 @@ public class CompareRequestImpl extends else { byte[] binVal = attrVal.getBytes(); - sb.append( StringTools.utf8ToString( binVal ) ).append( '/' ).append( Strings.dumpBytes(binVal) ) + sb.append( Strings.utf8ToString(binVal) ).append( '/' ).append( Strings.dumpBytes(binVal) ) .append( "'\n" ); } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java Mon Dec 20 14:31:29 2010 @@ -25,7 +25,6 @@ import java.util.Arrays; import javax.naming.NamingException; import javax.naming.ldap.ExtendedResponse; -import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.util.Strings; @@ -334,7 +333,7 @@ public class ExtendedRequestImpl extends if ( oid != null ) { - sb.append( " Request value : '" ).append( StringTools.utf8ToString( requestValue ) ).append( '/' ) + sb.append( " Request value : '" ).append( Strings.utf8ToString(requestValue) ).append( '/' ) .append( Strings.dumpBytes(requestValue) ).append( "'\n" ); } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java Mon Dec 20 14:31:29 2010 @@ -43,6 +43,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.util.StringTools; +import org.apache.directory.shared.util.Strings; /** @@ -243,14 +244,14 @@ public class LdapEncoder } else { - byte[] matchedDNBytes = StringTools.getBytesUtf8( StringTools - .trimLeft( ldapResult.getMatchedDn().getName() ) ); + byte[] matchedDNBytes = Strings.getBytesUtf8(StringTools + .trimLeft(ldapResult.getMatchedDn().getName())); ldapResultLength += 1 + TLV.getNbBytes( matchedDNBytes.length ) + matchedDNBytes.length; ldapResult.setMatchedDnBytes( matchedDNBytes ); } // The errorMessage length - byte[] errorMessageBytes = StringTools.getBytesUtf8( ldapResult.getErrorMessage() ); + byte[] errorMessageBytes = Strings.getBytesUtf8(ldapResult.getErrorMessage()); ldapResultLength += 1 + TLV.getNbBytes( errorMessageBytes.length ) + errorMessageBytes.length; ldapResult.setErrorMessageBytes( errorMessageBytes ); @@ -522,7 +523,7 @@ public class LdapEncoder } else { - byte[] mechanismBytes = StringTools.getBytesUtf8( bindRequest.getSaslMechanism() ); + byte[] mechanismBytes = Strings.getBytesUtf8(bindRequest.getSaslMechanism()); int saslMechanismLength = 1 + TLV.getNbBytes( mechanismBytes.length ) + mechanismBytes.length; int saslCredentialsLength = 0; @@ -607,7 +608,7 @@ public class LdapEncoder int compareRequestLength = 1 + TLV.getNbBytes( DN.getNbBytes( entry ) ) + DN.getNbBytes( entry ); // The attribute value assertion - byte[] attributeIdBytes = StringTools.getBytesUtf8( compareRequest.getAttributeId() ); + byte[] attributeIdBytes = Strings.getBytesUtf8(compareRequest.getAttributeId()); int avaLength = 1 + TLV.getNbBytes( attributeIdBytes.length ) + attributeIdBytes.length; compareRequest.setAttrIdBytes( attributeIdBytes ); @@ -619,7 +620,7 @@ public class LdapEncoder } else { - byte[] value = StringTools.getBytesUtf8( compareRequest.getAssertionValue().getString() ); + byte[] value = Strings.getBytesUtf8(compareRequest.getAssertionValue().getString()); avaLength += 1 + TLV.getNbBytes( value.length ) + value.length; compareRequest.setAttrValBytes( value ); } @@ -712,7 +713,7 @@ public class LdapEncoder */ private int computeExtendedRequestLength( ExtendedRequestImpl extendedRequest ) { - byte[] requestNameBytes = StringTools.getBytesUtf8( extendedRequest.getRequestName() ); + byte[] requestNameBytes = Strings.getBytesUtf8(extendedRequest.getRequestName()); extendedRequest.setRequestNameBytes( requestNameBytes ); @@ -757,9 +758,9 @@ public class LdapEncoder String id = extendedResponse.getResponseName(); - if ( !StringTools.isEmpty( id ) ) + if ( !Strings.isEmpty(id) ) { - byte[] idBytes = StringTools.getBytesUtf8( id ); + byte[] idBytes = Strings.getBytesUtf8(id); extendedResponse.setResponseNameBytes( idBytes ); int idLength = idBytes.length; extendedResponseLength += 1 + TLV.getNbBytes( idLength ) + idLength; @@ -799,9 +800,9 @@ public class LdapEncoder { int intermediateResponseLength = 0; - if ( !StringTools.isEmpty( intermediateResponse.getResponseName() ) ) + if ( !Strings.isEmpty(intermediateResponse.getResponseName()) ) { - byte[] responseNameBytes = StringTools.getBytesUtf8( intermediateResponse.getResponseName() ); + byte[] responseNameBytes = Strings.getBytesUtf8(intermediateResponse.getResponseName()); int responseNameLength = responseNameBytes.length; intermediateResponseLength += 1 + TLV.getNbBytes( responseNameLength ) + responseNameLength; @@ -975,7 +976,7 @@ public class LdapEncoder */ private int computeModifyDnRequestLength( ModifyDnRequestImpl modifyDnResponse ) { - int newRdnlength = StringTools.getBytesUtf8( modifyDnResponse.getNewRdn().getName() ).length; + int newRdnlength = Strings.getBytesUtf8(modifyDnResponse.getNewRdn().getName()).length; int modifyDNRequestLength = 1 + TLV.getNbBytes( DN.getNbBytes( modifyDnResponse.getName() ) ) + DN.getNbBytes( modifyDnResponse.getName() ) + 1 + TLV.getNbBytes( newRdnlength ) + newRdnlength + 1 + 1 @@ -1029,7 +1030,7 @@ public class LdapEncoder // Each referral for ( String ldapUrl : ldapUrls ) { - byte[] ldapUrlBytes = StringTools.getBytesUtf8( ldapUrl ); + byte[] ldapUrlBytes = Strings.getBytesUtf8(ldapUrl); referralLength += 1 + TLV.getNbBytes( ldapUrlBytes.length ) + ldapUrlBytes.length; referral.addLdapUrlBytes( ldapUrlBytes ); } @@ -1109,7 +1110,7 @@ public class LdapEncoder for ( String attribute : searchRequest.getAttributes() ) { // add the attribute length to the attributes length - int idLength = StringTools.getBytesUtf8( attribute ).length; + int idLength = Strings.getBytesUtf8(attribute).length; attributeDescriptionListLength += 1 + TLV.getNbBytes( idLength ) + idLength; } } @@ -1191,7 +1192,7 @@ public class LdapEncoder { DN dn = searchResultEntry.getObjectName(); - byte[] dnBytes = StringTools.getBytesUtf8( dn.getName() ); + byte[] dnBytes = Strings.getBytesUtf8(dn.getName()); // The entry int searchResultEntryLength = 1 + TLV.getNbBytes( dnBytes.length ) + dnBytes.length; @@ -1539,7 +1540,7 @@ public class LdapEncoder // The saslAuthentication Tag buffer.put( ( byte ) LdapConstants.BIND_REQUEST_SASL_TAG ); - byte[] mechanismBytes = StringTools.getBytesUtf8( bindRequest.getSaslMechanism() ); + byte[] mechanismBytes = Strings.getBytesUtf8(bindRequest.getSaslMechanism()); buffer.put( TLV .getBytes( bindRequest.getSaslMechanismLength() + bindRequest.getSaslCredentialsLength() ) ); Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java Mon Dec 20 14:31:29 2010 @@ -34,7 +34,7 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedure.StoredProcedureParameter; import org.apache.directory.shared.ldap.message.ExtendedRequestImpl; import org.apache.directory.shared.ldap.message.ResultResponse; -import org.apache.directory.shared.ldap.util.StringTools; +import org.apache.directory.shared.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -195,7 +195,7 @@ public class StoredProcedureRequest exte */ public void setProcedure( String procedure ) { - this.procedure.setProcedure( StringTools.getBytesUtf8( procedure ) ); + this.procedure.setProcedure( Strings.getBytesUtf8(procedure) ); } @@ -206,7 +206,7 @@ public class StoredProcedureRequest exte */ public String getProcedureSpecification() { - return StringTools.utf8ToString( procedure.getProcedure() ); + return Strings.utf8ToString(procedure.getProcedure()); } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java Mon Dec 20 14:31:29 2010 @@ -34,6 +34,7 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.message.ResultCodeEnum; import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.ldap.util.UTFUtils; +import org.apache.directory.shared.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -169,9 +170,9 @@ public class AVA implements Cloneable, C String upTypeTrimmed = StringTools.trim( upType ); String normTypeTrimmed = StringTools.trim( normType ); - if ( StringTools.isEmpty( upTypeTrimmed ) ) + if ( Strings.isEmpty(upTypeTrimmed) ) { - if ( StringTools.isEmpty( normTypeTrimmed ) ) + if ( Strings.isEmpty(normTypeTrimmed) ) { String message = I18n.err( I18n.ERR_04188 ); LOG.error( message ); @@ -184,7 +185,7 @@ public class AVA implements Cloneable, C this.upType = normType; } } - else if ( StringTools.isEmpty( normTypeTrimmed ) ) + else if ( Strings.isEmpty(normTypeTrimmed) ) { // In this case, we will use the upType instead this.normType = StringTools.lowerCaseAscii( upTypeTrimmed ); @@ -226,9 +227,9 @@ public class AVA implements Cloneable, C String upTypeTrimmed = StringTools.trim( upType ); String normTypeTrimmed = StringTools.trim( normType ); - if ( StringTools.isEmpty( upTypeTrimmed ) ) + if ( Strings.isEmpty(upTypeTrimmed) ) { - if ( StringTools.isEmpty( normTypeTrimmed ) ) + if ( Strings.isEmpty(normTypeTrimmed) ) { String message = I18n.err( I18n.ERR_04188 ); LOG.error( message ); @@ -241,7 +242,7 @@ public class AVA implements Cloneable, C this.upType = normType; } } - else if ( StringTools.isEmpty( normTypeTrimmed ) ) + else if ( Strings.isEmpty(normTypeTrimmed) ) { // In this case, we will use the upType instead this.normType = StringTools.lowerCaseAscii( upTypeTrimmed ); @@ -447,11 +448,11 @@ public class AVA implements Cloneable, C */ private int compareType( String val1, String val2 ) { - if ( StringTools.isEmpty( val1 ) ) + if ( Strings.isEmpty(val1) ) { - return StringTools.isEmpty( val2 ) ? 0 : -1; + return Strings.isEmpty(val2) ? 0 : -1; } - else if ( StringTools.isEmpty( val2 ) ) + else if ( Strings.isEmpty(val2) ) { return 1; } @@ -745,9 +746,9 @@ public class AVA implements Cloneable, C */ public void writeExternal( ObjectOutput out ) throws IOException { - if ( StringTools.isEmpty( upName ) - || StringTools.isEmpty( upType ) - || StringTools.isEmpty( normType ) + if ( Strings.isEmpty(upName) + || Strings.isEmpty(upType) + || Strings.isEmpty(normType) || ( start < 0 ) || ( length < 2 ) // At least a type and '=' || ( upValue.isNull() ) @@ -755,15 +756,15 @@ public class AVA implements Cloneable, C { String message = "Cannot serialize an wrong ATAV, "; - if ( StringTools.isEmpty( upName ) ) + if ( Strings.isEmpty(upName) ) { message += "the upName should not be null or empty"; } - else if ( StringTools.isEmpty( upType ) ) + else if ( Strings.isEmpty(upType) ) { message += "the upType should not be null or empty"; } - else if ( StringTools.isEmpty( normType ) ) + else if ( Strings.isEmpty(normType) ) { message += "the normType should not be null or empty"; } @@ -859,7 +860,7 @@ public class AVA implements Cloneable, C { StringBuffer sb = new StringBuffer(); - if ( StringTools.isEmpty( normType ) || StringTools.isEmpty( normType.trim() ) ) + if ( Strings.isEmpty(normType) || Strings.isEmpty(normType.trim()) ) { return ""; } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java Mon Dec 20 14:31:29 2010 @@ -27,8 +27,8 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.entry.StringValue; import org.apache.directory.shared.ldap.entry.Value; import org.apache.directory.shared.ldap.exception.LdapInvalidDnException; -import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.ldap.util.UTFUtils; +import org.apache.directory.shared.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,9 +80,9 @@ public final class AVASerializer */ public static void serialize( AVA atav, ObjectOutput out ) throws IOException { - if ( StringTools.isEmpty( atav.getUpName() ) - || StringTools.isEmpty( atav.getUpType() ) - || StringTools.isEmpty( atav.getNormType() ) + if ( Strings.isEmpty(atav.getUpName()) + || Strings.isEmpty(atav.getUpType()) + || Strings.isEmpty(atav.getNormType()) || ( atav.getStart() < 0 ) || ( atav.getLength() < 2 ) // At least a type and '=' || ( atav.getUpValue().isNull() ) @@ -90,15 +90,15 @@ public final class AVASerializer { String message = "Cannot serialize an wrong ATAV, "; - if ( StringTools.isEmpty( atav.getUpName() ) ) + if ( Strings.isEmpty(atav.getUpName()) ) { message += "the upName should not be null or empty"; } - else if ( StringTools.isEmpty( atav.getUpType() ) ) + else if ( Strings.isEmpty(atav.getUpType()) ) { message += "the upType should not be null or empty"; } - else if ( StringTools.isEmpty( atav.getNormType() ) ) + else if ( Strings.isEmpty(atav.getNormType()) ) { message += "the normType should not be null or empty"; } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java Mon Dec 20 14:31:29 2010 @@ -36,6 +36,7 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.schema.SchemaManager; import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer; import org.apache.directory.shared.ldap.util.StringTools; +import org.apache.directory.shared.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -409,7 +410,7 @@ public class DN implements Cloneable, Se { this.normName = rdn.getNormName(); this.upName = rdn.getName(); - this.bytes = StringTools.getBytesUtf8( normName ); + this.bytes = Strings.getBytesUtf8(normName); normalized = new AtomicBoolean( true ); } else @@ -502,7 +503,7 @@ public class DN implements Cloneable, Se if ( ( normName == null ) || !normName.equals( newNormName ) ) { - bytes = StringTools.getBytesUtf8( newNormName ); + bytes = Strings.getBytesUtf8(newNormName); normName = newNormName; } @@ -1095,7 +1096,7 @@ public class DN implements Cloneable, Se // Concatenate the rdns clonedDn.rdns.addAll( clonedDn.size() - posn, dn.rdns ); - if ( StringTools.isEmpty( normName ) ) + if ( Strings.isEmpty(normName) ) { clonedDn.normName = dn.normName; clonedDn.bytes = dn.bytes; @@ -1104,7 +1105,7 @@ public class DN implements Cloneable, Se else { clonedDn.normName = dn.normName + "," + normName; - clonedDn.bytes = StringTools.getBytesUtf8( normName ); + clonedDn.bytes = Strings.getBytesUtf8(normName); clonedDn.upName = dn.upName + "," + upName; } @@ -1142,7 +1143,7 @@ public class DN implements Cloneable, Se if ( clonedDn.size() != 0 ) { clonedDn.normName = dn.getNormName() + "," + normName; - clonedDn.bytes = StringTools.getBytesUtf8( normName ); + clonedDn.bytes = Strings.getBytesUtf8(normName); clonedDn.upName = dn.getName() + "," + upName; } } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java Mon Dec 20 14:31:29 2010 @@ -26,8 +26,8 @@ import java.util.ArrayList; import java.util.List; import org.apache.directory.shared.i18n.I18n; -import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.ldap.util.UTFUtils; +import org.apache.directory.shared.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -140,7 +140,7 @@ public final class DnSerializer } // Should we read the byte[] ??? - byte[] bytes = StringTools.getBytesUtf8( upName ); + byte[] bytes = Strings.getBytesUtf8(upName); // Read the RDNs. Is it's null, the number will be -1. int nbRdns = in.readInt(); Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java Mon Dec 20 14:31:29 2010 @@ -43,6 +43,7 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.ldap.util.UTFUtils; import org.apache.directory.shared.util.CharConstants; +import org.apache.directory.shared.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -1165,7 +1166,7 @@ public class RDN implements Cloneable, C */ public static Object unescapeValue( String value ) throws IllegalArgumentException { - if ( StringTools.isEmpty( value ) ) + if ( Strings.isEmpty(value) ) { return ""; } @@ -1309,7 +1310,7 @@ public class RDN implements Cloneable, C } } - return StringTools.utf8ToString( bytes, pos ); + return Strings.utf8ToString(bytes, pos); } } @@ -1322,7 +1323,7 @@ public class RDN implements Cloneable, C */ public static String escapeValue( String value ) { - if ( StringTools.isEmpty( value ) ) + if ( Strings.isEmpty(value) ) { return ""; } @@ -1441,12 +1442,12 @@ public class RDN implements Cloneable, C */ public static String escapeValue( byte[] attrValue ) { - if ( StringTools.isEmpty( attrValue ) ) + if ( Strings.isEmpty(attrValue) ) { return ""; } - String value = StringTools.utf8ToString( attrValue ); + String value = Strings.utf8ToString(attrValue); return escapeValue( value ); } @@ -1597,7 +1598,7 @@ public class RDN implements Cloneable, C // Read the normName normName = UTFUtils.readUTF( in ); - if ( StringTools.isEmpty( normName ) ) + if ( Strings.isEmpty(normName) ) { normName = upName; } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java Mon Dec 20 14:31:29 2010 @@ -23,8 +23,8 @@ import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.ldap.util.UTFUtils; +import org.apache.directory.shared.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -119,7 +119,7 @@ public final class RdnSerializer // Read the normName String normName = UTFUtils.readUTF( in ); - if ( StringTools.isEmpty( normName ) ) + if ( Strings.isEmpty(normName) ) { normName = upName; } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java Mon Dec 20 14:31:29 2010 @@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap import org.apache.directory.shared.i18n.I18n; import org.apache.directory.shared.ldap.exception.LdapException; import org.apache.directory.shared.ldap.schema.registries.Registries; -import org.apache.directory.shared.ldap.util.StringTools; +import org.apache.directory.shared.util.Strings; /** @@ -193,7 +193,7 @@ public abstract class LoadableSchemaObje { String className = this.getClass().getName(); - if ( StringTools.isEmpty( fqcn ) ) + if ( Strings.isEmpty(fqcn) ) { fqcn = className; return true; Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java Mon Dec 20 14:31:29 2010 @@ -22,8 +22,8 @@ package org.apache.directory.shared.ldap import java.io.IOException; -import org.apache.directory.shared.ldap.util.StringTools; import org.apache.directory.shared.ldap.util.unicode.InvalidCharacterException; +import org.apache.directory.shared.util.Strings; /** * @@ -4611,7 +4611,7 @@ public final class PrepareString */ private static String insignifiantCharTelephoneNumber( String str ) { - if ( StringTools.isEmpty( str ) ) + if ( Strings.isEmpty(str) ) { return ""; } @@ -4665,7 +4665,7 @@ public final class PrepareString */ private static String insignifiantCharNumericString( String str ) { - if ( StringTools.isEmpty( str ) ) + if ( Strings.isEmpty(str) ) { return ""; } @@ -4710,7 +4710,7 @@ public final class PrepareString */ private static String insignifiantSpacesString( String str, boolean caseSensitive ) throws InvalidCharacterException { - if ( StringTools.isEmpty( str ) ) + if ( Strings.isEmpty(str) ) { // Special case : an empty strings is replaced by 2 spaces return ""; Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java Mon Dec 20 14:31:29 2010 @@ -33,7 +33,7 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.entry.Modification; import org.apache.directory.shared.ldap.entry.Value; import org.apache.directory.shared.ldap.exception.LdapException; -import org.apache.directory.shared.ldap.util.StringTools; +import org.apache.directory.shared.util.Strings; /** @@ -1081,7 +1081,7 @@ public final class SchemaUtils buf.append( " FQCN " ).append( description.getFqcn() ); - if ( !StringTools.isEmpty( description.getBytecode() ) ) + if ( !Strings.isEmpty(description.getBytecode()) ) { buf.append( " BYTECODE " ).append( description.getBytecode() ); } @@ -1150,7 +1150,7 @@ public final class SchemaUtils for ( String option:res ) { - if ( !StringTools.isEmpty( option ) ) + if ( !Strings.isEmpty(option) ) { options.add( option ); } Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectClassTypeComparator.java URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectClassTypeComparator.java?rev=1051130&r1=1051129&r2=1051130&view=diff ============================================================================== --- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectClassTypeComparator.java (original) +++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectClassTypeComparator.java Mon Dec 20 14:31:29 2010 @@ -21,7 +21,7 @@ package org.apache.directory.shared.ldap import org.apache.directory.shared.ldap.schema.LdapComparator; -import org.apache.directory.shared.ldap.util.StringTools; +import org.apache.directory.shared.util.Strings; /** @@ -79,7 +79,7 @@ public class ObjectClassTypeComparator