{
StringReader strIn = new StringReader( text );
BufferedReader in = new BufferedReader( strIn );
String line = null;
Attributes attributes = new AttributesImpl( true );
try
{
while ( ( line = ( ( BufferedReader ) in ).readLine() ) != null )
{
if ( line.length() == 0 )
{
continue;
}
String addedLine = line.trim();
if ( StringTools.isEmpty( addedLine ) )
{
continue;
}
javax.naming.directory.Attribute attribute = LdifReader.parseAttributeValue( addedLine );
javax.naming.directory.Attribute oldAttribute = attributes.get( attribute.getID() );
if ( oldAttribute != null )
{
try
{
oldAttribute.add( attribute.get() );
attributes.put( oldAttribute );
}
catch ( NamingException ne )
{
// Do nothing
}
}
else
{
attributes.put( attribute );
}
}
}
catch ( IOException ioe )
{