Author: sparkins@redhat.com
Summary: Re-implemented two bug fixes in the LDIFWriter class in order to allow us to relicense the LDAP JDK under the standard Mozilla tri-license.  The first bug had to do with the printEntryStart() method of the LDIFWriter class does not handling non-printable DN's properly.  The second bug had to do with only the first value of a multi-valued attribute being written out in LDIF format.
This commit is contained in:
nkinder%redhat.com 2007-03-21 18:21:16 +00:00
Родитель 8bd84092aa
Коммит dbafaffffe
1 изменённых файлов: 34 добавлений и 34 удалений

Просмотреть файл

@ -18,7 +18,6 @@
* Rights Reserved.
*
* Contributor(s):
* bugzilla 62700: Joe Rank (joer@trapdoor.net)
*/
package org.ietf.ldap.util;
@ -93,11 +92,7 @@ public class LDIFWriter extends LDAPWriter {
/* Loop on values for this attribute */
Enumeration enumVals = attr.getByteValues();
if ( enumVals == null ) {
printString( attrName + m_sep + ' ' );
return;
}
if ( enumVals != null ) {
while (enumVals.hasMoreElements()) {
if ( m_toFiles ) {
try {
@ -129,6 +124,9 @@ public class LDIFWriter extends LDAPWriter {
}
}
}
} else {
printString( attrName + m_sep + ' ' );
}
}
/**
@ -138,18 +136,20 @@ public class LDIFWriter extends LDAPWriter {
*/
protected void printEntryStart( String dn ) {
if ( dn == null ) {
dn = "";
printString( "dn" + m_sep + " ");
} else {
byte[] b = null;
try {
b = dn.getBytes( "UTF8" );
} catch ( UnsupportedEncodingException ex ) {
}
if ( !LDIF.isPrintable(b) ) {
dn = getPrintableValue( b );
}
}
if ( LDIF.isPrintable(b) ) {
printString( "dn" + m_sep + " " + dn );
} else {
dn = getPrintableValue( b );
printString( "dn" + m_sep + m_sep + " " + dn );
}
}
}
/**