How to load the repository workspace using load rule programatically??
One answer
You have to do the following
Comments
Hi ,i used the below code :
String f = "D:/SCM/test"+".loadrule";
InputStream ins = new FileInputStream(f);
Reader xmlReader = new InputStreamReader(ins);
ILoadRule2 rule = ILoadRuleFactory.loadRuleFactory.getLoadRule(StreamName, xmlReader, monitor);
ILoadOperation loadoperator = rule.getLoadOp(sandbox, p, monitor);
monitor.subTask("loading files from RTC server...");
loadoperator.run(monitor);
But When i try to run i get the below error :
Exception in thread "main" com.ibm.team.filesystem.client.FileSystemException: Error parsing load rule: schema_reference: Failed to read schema document 'LoadRule.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
How can i use the reader parameter ?
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 16.0px; font: 14.0px 'Helvetica Neue'; color: #333333; -webkit-text-stroke: #333333} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 16.0px; font: 14.0px 'Helvetica Neue'; color: #333333; -webkit-text-stroke: #333333; min-height: 16.0px} span.s1 {font-kerning: none} </style>
A bit of googling I found this link: https://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8
Try out one of the solutions and see if it works.
By the way, you should check ILoadRuleFactory.isXMLLoadRule(xmlReader) and if it returns true then call ILoadRuleFactory.getLoadRule(wsConn, xmlReader, monitor). Also I see that you are passing a "StreamName" to the getLoadRule method but it should be a IWorkspaceConnection.
Create a file named
jaxp.properties
(if it doesn’t exist) under path to your "JDK version/jre/lib" and then add the following line in it.
javax.xml.accessExternalSchema = all.
Any other solutions ?