Examples of LdifAttributesReader


Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

    {
        String ldif = "objectclass: top\n" + "objectclass: person\n" + "objectclass: organizationalPerson\n"
            + "cn: Horatio Jensen\n" + "cn: Horatio N Jensen\n" + "sn: Jensen\n" + "uid: hjensen\n"
            + "telephonenumber: +1 408 555 1212\n" + "jpegphoto:< file:" + HJENSEN_JPEG_FILE.getAbsolutePath() + "\n";

        LdifAttributesReader reader = new LdifAttributesReader();
        reader.setSizeLimit( 128 );

        try
        {
            reader.parseEntry( ldif );
            fail();
        }
        catch ( LdapLdifException ne )
        {
            assertTrue( I18n.err( I18n.ERR_12009_ERROR_PARSING_LDIF_BUFFER ), ne.getMessage().startsWith(
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

            + "#\n" + "# EXAMPLE.COM is freely and reserved for testing according to this RFC:\n" + "#\n"
            + "# http://www.rfc-editor.org/rfc/rfc2606.txt\n" + "#\n"
            + "# -------------------------------------------------------------------\n" + "\n" + "objectclass: top\n"
            + "objectclass: organizationalunit\n" + "ou: Users";

        LdifAttributesReader reader = new LdifAttributesReader();

        Attributes attributes = reader.parseAttributes( ldif );

        javax.naming.directory.Attribute attr = attributes.get( "objectclass" );
        assertTrue( attr.contains( "top" ) );
        assertTrue( attr.contains( "organizationalunit" ) );
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

            + "objectClass: subentry\n"
            + "objectClass: accessControlSubentry\n"
            + "subtreeSpecification: { maximum 1 }\n"
            + "prescriptiveACI: { identificationTag \"browseRoot\", precedence 100, authenticationLevel none, itemOrUserFirst userFirst: { userClasses { allUsers }, userPermissions { { protectedItems {entry}, grantsAndDenials { grantReturnDN, grantBrowse } } } } }\n";

        LdifAttributesReader reader = new LdifAttributesReader();
        Attributes attributes = reader.parseAttributes( ldif );

        javax.naming.directory.Attribute attr = attributes.get( "objectClass" );
        assertTrue( attr.contains( "top" ) );
        assertTrue( attr.contains( SchemaConstants.SUBENTRY_OC ) );
        assertTrue( attr.contains( "accessControlSubentry" ) );
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

        {
            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n
                .err( I18n.ERR_12087 ) );
        }

        LdifAttributesReader reader = new LdifAttributesReader();
        Entry entry = reader.parseEntry( schemaManager, sb.toString() );

        return entry;
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

        {
            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n
                .err( I18n.ERR_12087 ) );
        }

        LdifAttributesReader reader = new LdifAttributesReader();
        Entry entry = reader.parseEntry( schemaManager, sb.toString() );

        return entry;
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

        {
            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n
                .err( I18n.ERR_12087 ) );
        }

        LdifAttributesReader reader = null;
       
        try
        {
            reader = new LdifAttributesReader();
            Entry entry = reader.parseEntry( schemaManager, sb.toString() );
   
            return entry;
        }
        finally
        {
            try
            {
                reader.close();
            }
            catch ( IOException e )
            {
                e.printStackTrace();
            }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

        {
            throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n
                .err( I18n.ERR_12087 ) );
        }

        LdifAttributesReader reader = new LdifAttributesReader();
        Entry entry = reader.parseEntry( schemaManager, sb.toString() );

        return entry;
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

    @Test
    public void testLdifNull() throws LdapLdifException
    {
        String ldif = null;

        LdifAttributesReader reader = new LdifAttributesReader();
        Entry entry = reader.parseEntry( ldif );

        assertEquals( 0, entry.size() );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

    @Test
    public void testLdifEmpty() throws LdapLdifException
    {
        String ldif = "";

        LdifAttributesReader reader = new LdifAttributesReader();
        Entry entry = reader.parseEntry( ldif );

        assertEquals( 0, entry.size() );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.ldif.LdifAttributesReader

    @Test
    public void testLdifEmptyLines() throws LdapLdifException
    {
        String ldif = "\n\n\r\r\n";

        LdifAttributesReader reader = new LdifAttributesReader();
        Entry entry = reader.parseEntry( ldif );
        assertNull( entry );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.