use of org.bimserver.plugins.LocalMavenPluginBundle in project BIMserver by opensourceBIM.
the class InstallPluginBundleFromBytes method execute.
@Override
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException, ServerException {
LocalMavenPluginBundle mavenPluginBundle = new LocalMavenPluginBundle(data);
try {
List<SPluginInformation> pluginInformationFromPluginFile = bimServer.getPluginManager().getPluginInformationFromJar(new ByteArrayInputStream(data));
for (SPluginInformation sPluginInformation : pluginInformationFromPluginFile) {
sPluginInformation.setEnabled(true);
if (installAllPluginsForAllUsers) {
sPluginInformation.setInstallForAllUsers(true);
}
if (installAllPluginsForNewUsers) {
sPluginInformation.setInstallForNewUsers(true);
}
}
bimServer.getPluginManager().install(mavenPluginBundle, pluginInformationFromPluginFile, false);
} catch (Exception e) {
LOGGER.error("", e);
throw new UserException(e);
}
return null;
}
Aggregations