Package org.xmldb.api.base

Examples of org.xmldb.api.base.Collection.listResources()


                    handler.startElement(URI, COLLECTION, QCOLLECTION, attributes);
                    handler.endElement(URI, COLLECTION, QCOLLECTION);
                }

                // Print child resources
                String[] resources = collection.listResources();
                for (int i = 0; i < resources.length; i++) {
                    attributes.clear();
                    attributes.addAttribute("", NAME_ATTR, NAME_ATTR, CDATA, resources[i]);
                    handler.startElement(URI, RESOURCE, QRESOURCE, attributes);
                    handler.endElement(URI, RESOURCE, QRESOURCE);
View Full Code Here


                            QCOLLECTION, attributes);
                    handler.endElement(URI, COLLECTION, QCOLLECTION);
                }

                // Print child resources
                String[] resources = collection.listResources();
                for (int i = 0; i < resources.length; i++) {
                    attributes.clear();
                    attributes.addAttribute("", NAME_ATTR, NAME_ATTR, CDATA, resources[i]);
                    handler.startElement(URI, RESOURCE,
                            QRESOURCE, attributes);
View Full Code Here

                    handler.startElement(URI, COLLECTION, QCOLLECTION, attributes);
                    handler.endElement(URI, COLLECTION, QCOLLECTION);
                }

                // Print child resources
                String[] resources = collection.listResources();
                for (int i = 0; i < resources.length; i++) {
                    attributes.clear();
                    attributes.addAttribute("", NAME_ATTR, NAME_ATTR, CDATA, resources[i]);
                    handler.startElement(URI, RESOURCE, QRESOURCE, attributes);
                    handler.endElement(URI, RESOURCE, QRESOURCE);
View Full Code Here

                col = DatabaseManager.getCollection(colstring);
                if (col == null) {
                    System.out.println("ERROR : Collection not found!");
                    return false;
                }
                documentarray = col.listResources();

                System.out.println();

                for (int i = 0; i < documentarray.length; i++) {
                    System.out.println("\t" + documentarray[i]);
View Full Code Here

                            QCOLLECTION, attributes);
                    handler.endElement(URI, COLLECTION, COLLECTION);
                }

                // Print child resources
                String[] resources = collection.listResources();
                for (int i = 0; i < resources.length; i++) {
                    attributes.clear();
                    attributes.addAttribute("", NAME_ATTR, NAME_ATTR, CDATA, resources[i]);
                    handler.startElement(URI, RESOURCE,
                            QRESOURCE, attributes);
View Full Code Here

                            QCOLLECTION, attributes);
                    handler.endElement(URI, COLLECTION, QCOLLECTION);
                }

                // Print child resources
                String[] resources = collection.listResources();
                for (int i = 0; i < resources.length; i++) {
                    attributes.clear();
                    attributes.addAttribute("", NAME_ATTR, NAME_ATTR, CDATA, resources[i]);
                    handler.startElement(URI, RESOURCE,
                            QRESOURCE, attributes);
View Full Code Here

    @Test
    public void readResource() throws XMLDBException {
        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);
        assertNotNull(testCollection);
        String[] resources = testCollection.listResources();
        assertEquals(resources.length, testCollection.getResourceCount());

        System.out.println("reading " + resources[0]);
        XMLResource doc = (XMLResource) testCollection.getResource(resources[0]);
        assertNotNull(doc);
View Full Code Here

    public boolean execute() throws Exception {
        Collection col = DatabaseManager.getCollection(collectionPath, "admin", null);
        Collection target = DBUtils.addCollection(col, "C" + ++collectionCnt);
        addFiles(target);
        System.out.println("Resources in collection " + target.getName());
        String resources[] = target.listResources();
        for (int i = 0; i < resources.length; i++) {
            System.out.println(resources[i]);
        }
       
        CollectionManagementServiceImpl mgt = (CollectionManagementServiceImpl)
View Full Code Here

           mgt.copyResource(target.getName() + '/' + resources[i],
                   copy.getName(), null);
        }
       
        System.out.println("Resources in collection " + copy.getName());
        resources = copy.listResources();
        for (int i = 0; i < resources.length; i++) {
            System.out.println(resources[i]);
        }
        return false;
    }
View Full Code Here

        cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");
        cms.copy("/db/securityTest3/source", "/db/securityTest3", "copy-of-source");

        final Collection copyOfSource = test.getChildCollection("copy-of-source");
        assertNotNull(copyOfSource);
        assertEquals(2, copyOfSource.listResources().length);
    }
   
    /**
     * As the 'test1' user, creates the collection and resource:
     *
 
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.