Package javax.naming.directory

Examples of javax.naming.directory.DirContext.list()


        DirContext attributeDefinition = attr.getAttributeSyntaxDefinition();
        NamingEnumeration<NameClassPair> ne = attributeDefinition.list("");
        assertFalse(ne.hasMore());

        try {
            ne = attributeDefinition.list("invalid");
            fail("Should throw NameNotFoundException");
        } catch (NameNotFoundException e) {
            // Expected.
        }
        Attributes schemaAttributes = attributeDefinition.getAttributes("");
View Full Code Here


            log.trace("  Scanning TLDs in /WEB-INF subdirectory");
        }
        DirContext resources = context.getResources();
        if( resources!=null ) {
            try {
                NamingEnumeration items = resources.list("/WEB-INF");
                while (items.hasMoreElements()) {
                    NameClassPair item = (NameClassPair) items.nextElement();
                    String resourcePath = "/WEB-INF/" + item.getName();
                    // FIXME - JSP 2.0 is not explicit about whether we should
                    // scan subdirectories of /WEB-INF for TLDs also
View Full Code Here

        // Scan JARs in the /WEB-INF/lib subdirectory of the web application
        if (log.isTraceEnabled()) {
            log.trace("  Scanning JARs in /WEB-INF/lib subdirectory");
        }
        try {
            NamingEnumeration items = resources.list("/WEB-INF/lib");
            while (items.hasMoreElements()) {
                NameClassPair item = (NameClassPair) items.nextElement();
                String resourcePath = "/WEB-INF/lib/" + item.getName();
                if (!resourcePath.endsWith(".jar")) {
                    continue;
View Full Code Here

    @Test
    public void testOpen() throws Exception {
        DirContext ctx = authMap.open();
        HashSet<String> set = new HashSet<String>();
        NamingEnumeration list = ctx.list("ou=destinations,o=ActiveMQ,ou=system");
        while (list.hasMore()) {
            NameClassPair ncp = (NameClassPair) list.next();
            set.add(ncp.getName());
        }
        assertTrue(set.contains("ou=topics"));
View Full Code Here

            }

            // Looking up directory /WEB-INF/lib in the context
            NamingEnumeration<NameClassPair> enumeration = null;
            try {
                enumeration = libDir.list("");
            } catch (NamingException e) {
                IOException ioe = new IOException(sm.getString(
                        "webappLoader.namingFailure", libPath));
                ioe.initCause(e);
                throw ioe;
View Full Code Here

            assertTrue("WEB-INF entry is a DirContext",
                       webInfEntry instanceof DirContext);
            DirContext webInfContext = (DirContext) webInfEntry;

            // Check the contents of the WEB-INF context directly
            checkList(webInfContext.list(""), webInfNames);

        } catch (NamingException e) {
            fail("NamingException: " + e);
        }
View Full Code Here

        if (debug >= 2) {
            log("  Scanning TLDs in /WEB-INF subdirectory");
        }
        DirContext resources = context.getResources();
        try {
            NamingEnumeration items = resources.list("/WEB-INF");
            while (items.hasMoreElements()) {
                NameClassPair item = (NameClassPair) items.nextElement();
                String resourcePath = "/WEB-INF/" + item.getName();
                // FIXME - JSP 1.2 is not explicit about whether we should
                // scan subdirectories of /WEB-INF for TLDs also
View Full Code Here

        // Scan JARs in the /WEB-INF/lib subdirectory of the web application
        if (debug >= 2) {
            log("  Scanning JARs in /WEB-INF/lib subdirectory");
        }
        try {
            NamingEnumeration items = resources.list("/WEB-INF/lib");
            while (items.hasMoreElements()) {
                NameClassPair item = (NameClassPair) items.nextElement();
                String resourcePath = "/WEB-INF/lib/" + item.getName();
                if (!resourcePath.endsWith(".jar")) {
                    continue;
View Full Code Here

        // Perform search using URL
        // NamingEnumeration answer = ctx.search(
        // "ldap://localhost:389/ou=system", "(uid=admin)", null);
        HashSet set = new HashSet();

        NamingEnumeration list = ctx.list("ou=system");

        while (list.hasMore()) {
            NameClassPair ncp = (NameClassPair) list.next();
            set.add(ncp.getName());
        }
View Full Code Here

        if (debug >= 2) {
            log("  Scanning TLDs in /WEB-INF subdirectory");
        }
        DirContext resources = context.getResources();
        try {
            NamingEnumeration items = resources.list("/WEB-INF");
            while (items.hasMoreElements()) {
                NameClassPair item = (NameClassPair) items.nextElement();
                String resourcePath = "/WEB-INF/" + item.getName();
                // FIXME - JSP 1.2 is not explicit about whether we should
                // scan subdirectories of /WEB-INF for TLDs also
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.