Examples of createCollection()


Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

        //it should inherit the group ownership 'users' from the parent collection which is setGid
        //and it should inherit the setGid bit
        parentCollection = DatabaseManager.getCollection(baseUri + "/db/securityTest2/parentCollection", "test3", "test3");
        ums = (UserManagementService)parentCollection.getService("UserManagementService", "1.0");
        cms = (CollectionManagementService)parentCollection.getService("CollectionManagementService", "1.0");
        final Collection subCollection = cms.createCollection("subCollection1");

        final Permission permissions = ums.getPermissions(subCollection);
        assertEquals("users", permissions.getGroup().getName());
        assertTrue(permissions.isSetGid());
    }
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

    public void noSetGid_createResource_resourceGroupIsUsersPrimaryGroup() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest2", "test1", "test1");
        CollectionManagementService cms = (CollectionManagementService)test.getService("CollectionManagementService", "1.0");

        //create /db/securityTest2/parentCollection with owner "test1:users" and mode "rwxrwxrwx"
        Collection parentCollection = cms.createCollection("parentCollection");
        UserManagementService ums = (UserManagementService)parentCollection.getService("UserManagementService", "1.0");
        ums.chmod("rwxrwxrwx");

        //now create the sub-resource /db/securityTest2/parentCollection/test.xml
        //as "user3:guest", it should have it's group set to the primary group of user3 i.e. 'guest'
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

    public void setGid_createResource_resourceGroupInheritedFromParent() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest2", "test1", "test1");
        CollectionManagementService cms = (CollectionManagementService)test.getService("CollectionManagementService", "1.0");

        //create /db/securityTest2/parentCollection with owner "test1:users" and mode "rwxrwsrwx"
        Collection parentCollection = cms.createCollection("parentCollection");
        UserManagementService ums = (UserManagementService)parentCollection.getService("UserManagementService", "1.0");
        ums.chmod("rwxrwsrwx");

        //now as "test3:guest" create the sub-resource /db/securityTest2/parentCollection/test.xml
        //it should inherit the group ownership 'users' from the parent which is setGid
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

            user.setPassword("test3");
            ums.addAccount(user);

            // create a collection /db/securityTest1 as owned by "test1:users" and mode 0770
            CollectionManagementService cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
            Collection test = cms.createCollection("securityTest1");
            ums = (UserManagementService) test.getService("UserManagementService", "1.0");
            //change ownership to test1
            final Account test1 = ums.getAccount("test1");
            ums.chown(test1, "users");
            // full permissions for user and group, none for world
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

            test.storeResource(resource);
            ums.chmod(resource, 0770);

            // create a collection /db/securityTest2 as user "test1"
            cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
            Collection testCol2 = cms.createCollection("securityTest2");
            ums = (UserManagementService) testCol2.getService("UserManagementService", "1.0");
            //change ownership to test1
            ums.chown(test1, "users");
            // full permissions for user and group, none for world
            ums.chmod(0775);
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

            // full permissions for user and group, none for world
            ums.chmod(0775);

            // create a collection /db/securityTest3 as user "test3"
            cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
            Collection testCol3 = cms.createCollection("securityTest3");
            ums = (UserManagementService) testCol3.getService("UserManagementService", "1.0");
            //change ownership to test3
            final Account test3 = ums.getAccount("test3");
            ums.chown(test3, "users");
            // full permissions for all
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

        DatabaseManager.getCollection(baseURI, "admin", "");
      CollectionManagementService cms =
        (CollectionManagementService) rootColl.getService(
          "CollectionManagementService",
          "1.0");
      cms.createCollection("A"); // jmv
      cms.removeCollection("A");
      cms.createCollection("A");
      Collection coll = rootColl.getChildCollection("A");

      XMLResource r =
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

        (CollectionManagementService) rootColl.getService(
          "CollectionManagementService",
          "1.0");
      cms.createCollection("A"); // jmv
      cms.removeCollection("A");
      cms.createCollection("A");
      Collection coll = rootColl.getChildCollection("A");

      XMLResource r =
        (XMLResource) coll.createResource(
          name,
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

    @Before
    public void setUp() throws XMLDBException {
        //create a test collection
        Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
        CollectionManagementService cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
        Collection testCollection = cms.createCollection(TEST_COLLECTION);
        UserManagementService ums = (UserManagementService) testCollection.getService("UserManagementService", "1.0");
        // change ownership to guest
        Account guest = ums.getAccount(GUEST_UID);
        ums.chown(guest, guest.getPrimaryGroup());
        ums.chmod("rwxr-xr-x");
View Full Code Here

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()

        database.setProperty("create-database", "true");
        DatabaseManager.registerDatabase(database);

        Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
        CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
        testCollection = service.createCollection(TEST_COLLECTION);
        assertNotNull(testCollection);
    }

    @After
    public void tearDown() throws XMLDBException {
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.