Package org.xmldb.api.base

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


        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);
        ums = (UserManagementService) copyOfSource.getService("UserManagementService", "1.0");
       
        //permissions should NOT have changed as the dest already existed!
        Permission permissions = ums.getPermissions(copyOfSource);
        assertEquals("test1", permissions.getOwner().getName());
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

                            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

                    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

        Resource newResource = collection.createResource(null, "BinaryResource");
        newResource.setContent(new byte[] { 0x00, 0x10, 0x01, 0x11 });
        collection.storeResource(newResource);
        String id = newResource.getId();

        String[] resources = collection.listResources();
        assertNotNull("Can not be null", resources);
        assertEquals("Should have one resource", 1, resources.length);
        assertEquals("Resource ID should match", id, resources[0]);

        collection.removeResource(newResource);
View Full Code Here

    }


    public String[] listDocuments(String path) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        return col.listResources();
    }

    public void removeDocument(String path, String name) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
View Full Code Here

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

            String[] documentarray = col.listResources();
            System.out.println();

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

                return false;
            }

            String[] files = null;
            try {
                files = col.listResources();
            } catch (XMLDBException e) {
                // Xindice will throw an error if there is no indexer
                if (e.errorCode != ErrorCodes.VENDOR_ERROR) {
                    throw e;
                }
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

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.