parameters.put(SessionParameter.BINDING_TYPE, bindingType.value());
// get factory and create binding
CmisBindingFactory factory = CmisBindingFactory.newInstance();
CmisBinding binding = null;
if (bindingType == BindingType.ATOMPUB) {
parameters.put(SessionParameter.ATOMPUB_URL, url);
binding = factory.createCmisAtomPubBinding(parameters);
} else if (bindingType == BindingType.WEBSERVICES) {
parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "/ACLService?wsdl");
parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "/DiscoveryService?wsdl");
parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "/MultiFilingService?wsdl");
parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "/NavigationService?wsdl");
parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "/ObjectService?wsdl");
parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "/PolicyService?wsdl");
parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "/RelatinshipService?wsdl");
parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "/RepositoryService?wsdl");
parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "/VersioningService?wsdl");
binding = factory.createCmisWebServicesBinding(parameters);
} else if (bindingType == BindingType.BROWSER) {
parameters.put(SessionParameter.BROWSER_URL, url);
binding = factory.createCmisBrowserBinding(parameters);
} else {
LOG.error("Unknown binding type: " + bindingType.value());
return;
}
objFactory = binding.getObjectFactory();
repSvc = binding.getRepositoryService();
objSvc = binding.getObjectService();
navSvc = binding.getNavigationService();
verSvc = binding.getVersioningService();
multiSvc = binding.getMultiFilingService();
discSvc = binding.getDiscoveryService();
aclSvc = binding.getAclService();
// create a folder where target files will be stored:
targetDir = bindingType.value();
File in = new File(targetDir);
boolean ok = in.mkdir();