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);
    }
   
    /**
     * As the 'test1' user, creates the collection and resource:
     *
 
View Full Code Here


        }

        assertEquals(filenames, storedResourceNames);

        //get a list from the database of stored resource names
        final List<String> retrievedStoredResourceNames = Arrays.asList(testCollection.listResources());

        //order of names from database may not be the order in which the files were loaded!
        Collections.sort(filenames);
        Collections.sort(retrievedStoredResourceNames);
View Full Code Here

        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
        final UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");

        ums.chmod("r-x------");

        test.listResources();
    }

    @Test(expected=XMLDBException.class)
    public void cannotListCollectionResourcesWithoutRead() throws XMLDBException {
        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
View Full Code Here

        ums.chmod("-wx-wx-wx");
        test.close();

        test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");

        test.listResources();
    }

    @Test
    public void onlyReadAndExecuteRequiredToListCollectionSubCollections() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
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);
       
        final Resource resCopyOfSource1 = copyOfSource.getResource("source1.xml");
        assertEquals("<test1/>", resCopyOfSource1.getContent().toString());
       
        final Resource resCopyOfSource2 = copyOfSource.getResource("source2.xml");
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);
       
        final Collection copyOfSub = copyOfSource.getChildCollection("sub");
        assertNotNull(copyOfSub);
        assertEquals(1, copyOfSub.listResources().length);
    }
View Full Code Here

        assertNotNull(copyOfSource);
        assertEquals(2, copyOfSource.listResources().length);
       
        final Collection copyOfSub = copyOfSource.getChildCollection("sub");
        assertNotNull(copyOfSub);
        assertEquals(1, copyOfSub.listResources().length);
    }

    @Test
    public void copyDocument_doesNotPreservePermissions() throws XMLDBException {
        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test1", "test1");
View Full Code Here

                }
            }

            if( hasResources ) {
                log( "Listing resources", Project.MSG_DEBUG );
                final String[] resources = base.listResources();

                if( resources != null ) {

                    if( buffer.length() > 0 ) {
                        buffer.append( separator );
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);
       
        final Collection copyOfSub = copyOfSource.getChildCollection("sub");
        assertNotNull(copyOfSub);
        assertEquals(1, copyOfSub.listResources().length);
       
View Full Code Here

        assertNotNull(copyOfSource);
        assertEquals(2, copyOfSource.listResources().length);
       
        final Collection copyOfSub = copyOfSource.getChildCollection("sub");
        assertNotNull(copyOfSub);
        assertEquals(1, copyOfSub.listResources().length);
       
        //collection should be owned by test3:guest, i.e. permissions were not preserved from the test1 users doc /db/securityTest3/source
        UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");
        Permission permissions = ums.getPermissions(copyOfSource);
        assertEquals("test3", permissions.getOwner().getName());
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.