public void start(int id, String address, int port, int pbport, Path[] pluginDirectories) { BimServerConfig config = new BimServerConfig(); config.setHomeDir(Paths.get("home" + id)); config.setResourceFetcher(new LocalDevelopmentResourceFetcher(Paths.get("../"))); config.setStartEmbeddedWebServer(true); config.setClassPath(System.getProperty("java.class.path")); config.setLocalDev(true); config.setPort(port); config.setStartCommandLine(true); bimServer = new BimServer(config); bimServer.getVersionChecker().getLocalVersion().setDate(new Date()); try { if (pluginDirectories == null || pluginDirectories.length == 0) { LOGGER.warn( "No plugin directories given, this BIMserver will probably not work as expected, see https://github.com/opensourceBIM/BIMserver/wiki/Eclipse#adding-the-plugins-property"); } LocalDevPluginLoader.loadPlugins(bimServer.getPluginManager(), pluginDirectories); Path homeDirPlugins = config.getHomeDir().resolve("plugins"); if (Files.isDirectory(homeDirPlugins)) { bimServer.getPluginManager().loadAllPluginsFromDirectoryOfJars(homeDirPlugins); } bimServer.start(); if (bimServer.getServerInfo().getServerState() == ServerState.NOT_SETUP) { AdminInterface adminInterface = bimServer .getServiceFactory() .get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL) .get(AdminInterface.class); adminInterface.setup( "http://*****:*****@bimserver.org", "Administrator", "*****@*****.**", "admin"); SettingsInterface settingsInterface = bimServer .getServiceFactory() .get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL) .get(SettingsInterface.class); settingsInterface.setCacheOutputFiles(false); } } catch (PluginException e) { LOGGER.error("", e); } catch (ServiceException e) { LOGGER.error("", e); } catch (DatabaseInitException e) { LOGGER.error("", e); } catch (BimserverDatabaseException e) { LOGGER.error("", e); } catch (DatabaseRestartRequiredException e) { LOGGER.error("", e); } catch (IOException e) { LOGGER.error("", e); } }
public void start(int id, String address, int port, int pbport, File[] pluginDirectories) { BimServerConfig config = new BimServerConfig(); config.setHomeDir(new File("home" + id)); config.setResourceFetcher(new LocalDevelopmentResourceFetcher(new File("../"))); config.setStartEmbeddedWebServer(true); config.setClassPath(System.getProperty("java.class.path")); config.setLocalDev(true); config.setPort(port); config.setStartCommandLine(true); bimServer = new BimServer(config); bimServer.getVersionChecker().getLocalVersion().setDate(new Date()); try { LocalDevPluginLoader.loadPlugins(bimServer.getPluginManager(), pluginDirectories); bimServer.start(); if (bimServer.getServerInfo().getServerState() == ServerState.NOT_SETUP) { AdminInterface adminInterface = bimServer .getServiceFactory() .get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL) .get(AdminInterface.class); adminInterface.setup( "http://*****:*****@bimserver.org", "Administrator", "*****@*****.**", "admin"); SettingsInterface settingsInterface = bimServer .getServiceFactory() .get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL) .get(SettingsInterface.class); settingsInterface.setCacheOutputFiles(false); } } catch (PluginException e) { LOGGER.error("", e); } catch (ServiceException e) { LOGGER.error("", e); } catch (DatabaseInitException e) { LOGGER.error("", e); } catch (BimserverDatabaseException e) { LOGGER.error("", e); } catch (DatabaseRestartRequiredException e) { LOGGER.error("", e); } }