Collection root =
DatabaseManager.getCollection(
uri,
"admin",
null);
CollectionManagementService service =
(CollectionManagementService) root.getService(
"CollectionManagementService",
"1.0");
testCollection = service.createCollection("test");
assertNotNull(testCollection);
Resource xr = testCollection.createResource("hamlet.xml", "XMLResource");
String existHome = System.getProperty("exist.home");
File existDir = existHome == null ? new File(".") : new File(existHome);
File f = new File(existDir,"samples/shakespeare/hamlet.xml");
xr.setContent(f);
testCollection.storeResource(xr);
xmlrpcCollection = service.createCollection("xmlrpc");
assertNotNull(xmlrpcCollection);
Resource br = xmlrpcCollection.createResource(TestConstants.TEST_MODULE_URI.toString(), "BinaryResource");
((EXistResource) br).setMimeType(MimeType.XQUERY_TYPE.getName());
br.setContent(XmlRpcTest.MODULE_DATA);