Package org.apache.directory.shared.ldap.message

Examples of org.apache.directory.shared.ldap.message.AttributesImpl


    {
        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 )
        {
View Full Code Here


    {
        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 )
        {
View Full Code Here

    {
        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 )
        {
View Full Code Here

                dependenciesAttribute.add( dependency.getName() );
            }
        }

        // Building attributes
        Attributes attributes = new AttributesImpl();
        attributes.put( objectClassAttribute );
        attributes.put( cnAttribute );
        if ( dependenciesAttribute != null )
        {
            attributes.put( dependenciesAttribute );
        }

        // Schema entry's DN
        String dn = "cn=" + schema.getName() + "," + SCHEMA_BASE_DN;
View Full Code Here

        objectClassAttribute.add( "organizationalUnit" );

        Attribute ouAttribute = new AttributeImpl( "ou" );
        ouAttribute.add( ouValue );

        Attributes attributes = new AttributesImpl();
        attributes.put( objectClassAttribute );
        attributes.put( ouAttribute );

        wrapper.createEntry( dn, attributes, controls, monitor );
    }
View Full Code Here

    {
        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 )
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.message.AttributesImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.