use of org.bimserver.utils.FileDataSource in project BIMserver by opensourceBIM.
the class TestInstall method main.
public static void main(String[] args) {
ArrayList<String> pluginList = new ArrayList<>();
pluginList.add("C:/plugins/ifcplugins-0.0.15.jar");
try (BimServerClientFactory factory = new JsonBimServerClientFactory("http://localhost:8080")) {
BimServerClientInterface client = factory.create(new UsernamePasswordAuthenticationInfo("admin@bimserver.org", "admin"));
for (String each : pluginList) {
try {
DataSource fds = new FileDataSource(new File(each));
DataHandler handler = new DataHandler(fds);
client.getPluginInterface().installPluginBundleFromFile(handler, true, true);
System.out.println("Plugin " + each + " successfully installed !");
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (BimServerClientException e1) {
e1.printStackTrace();
} catch (ServiceException e1) {
e1.printStackTrace();
} catch (ChannelConnectionException e1) {
e1.printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
}
}
Aggregations