/** * <p>getViewsDisplayFile</p> * * @return a {@link java.io.File} object. * @throws java.io.IOException if any. */ public File getViewsDisplayFile() throws IOException { if (m_viewsDisplayFile == null) { m_viewsDisplayFile = ConfigFileConstants.getFile(ConfigFileConstants.VIEWS_DISPLAY_CONF_FILE_NAME); } return m_viewsDisplayFile; }
/** * Load the config from the default config file and create the singleton * instance of this factory. * * @exception java.io.IOException * Thrown if the specified config file cannot be read * @throws java.io.IOException if any. * @throws java.lang.ClassNotFoundException if any. */ protected DatabaseChecker() throws IOException, ClassNotFoundException { this(ConfigFileConstants.getFile(ConfigFileConstants.OPENNMS_DATASOURCE_CONFIG_FILE_NAME).getPath()); }
/** * <p>findDefaultConfigResource</p> * * @return a {@link org.springframework.core.io.Resource} object. * @throws java.io.IOException if any. */ protected static Resource findDefaultConfigResource() throws IOException { File configFile = ConfigFileConstants.getFile(ConfigFileConstants.MICROBLOG_CONFIG_FILE_NAME); return new FileSystemResource(configFile); }
/** {@inheritDoc} */ @Override protected void saveXML(String xmlString) throws IOException { File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.THRESHD_CONFIG_FILE_NAME); Writer fileWriter = new OutputStreamWriter(new FileOutputStream(cfgFile), StandardCharsets.UTF_8); fileWriter.write(xmlString); fileWriter.flush(); fileWriter.close(); }
public static ReadOnlyPollerConfigManager create() throws IOException { final File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONFIG_FILE_NAME); try (InputStream is = new FileInputStream(cfgFile)) { return new ReadOnlyPollerConfigManager(is); } }
/** * <p>update</p> * * @throws java.io.FileNotFoundException if any. * @throws java.io.IOException if any. */ @Override public void update() throws FileNotFoundException, IOException { InputStream configIn = new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.NOTIF_COMMANDS_CONF_FILE_NAME)); parseXML(configIn); } }
public SnmpAssetAdapterConfigFactory() throws IOException { final File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.SNMP_ASSET_ADAPTER_CONFIG_FILE_NAME); LOG.debug("init: config file path: {}", cfgFile.getPath()); final InputStream reader = new FileInputStream(cfgFile); m_config = new SnmpAssetAdapterConfigManager(cfgFile.lastModified(), reader); IOUtils.closeQuietly(reader); }
public JdbcDataCollectionConfigFactory() { try { File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.JDBC_COLLECTION_CONFIG_FILE_NAME); LOG.debug("init: config file path: {}", cfgFile.getPath()); InputStream reader = new FileInputStream(cfgFile); unmarshall(reader); reader.close(); } catch(IOException e) { // TODO rethrow. } }
/** * Parses the groups.xml * * @throws java.io.IOException if any. * @throws java.io.FileNotFoundException if any. */ public synchronized void reload() throws IOException, FileNotFoundException { File confFile = ConfigFileConstants.getFile(ConfigFileConstants.GROUPS_CONF_FILE_NAME); reloadFromFile(confFile); }
public static synchronized File getFile() throws IOException { if (s_configFile == null) { setFile(ConfigFileConstants.getFile(ConfigFileConstants.SNMP_CONF_FILE_NAME)); } return s_configFile; }
public WsManAssetAdapterConfigFactory() throws IOException { final File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.WSMAN_ASSET_ADAPTER_CONFIG_FILE_NAME); LOG.debug("init: config file path: {}", cfgFile.getPath()); final InputStream reader = new FileInputStream(cfgFile); m_config = new WsManAssetAdapterConfigManager(cfgFile.lastModified(), reader); IOUtils.closeQuietly(reader); }
private void reload() throws IOException { try (final Reader r = new FileReader(ConfigFileConstants.getFile(ConfigFileConstants.EVENTD_CONFIG_FILE_NAME))) { m_config = JaxbUtils.unmarshal(EventdConfiguration.class, r); } }
public ExcludeUeisProperties() throws FileNotFoundException, IOException { Properties excludeProperties = new Properties(); excludeProperties.load( new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.EXCLUDE_UEI_FILE_NAME))); m_ueis = BundleLists.parseBundleList(excludeProperties.getProperty("excludes")); } }
public SnmpAssetAdapterConfigFactory() throws IOException { final File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.SNMP_ASSET_ADAPTER_CONFIG_FILE_NAME); LOG.debug("init: config file path: {}", cfgFile.getPath()); final InputStream reader = new FileInputStream(cfgFile); m_config = new SnmpAssetAdapterConfigManager(cfgFile.lastModified(), reader); IOUtils.closeQuietly(reader); }
/** * Instantiates a new Service Configuration migrator offline. * * @throws OnmsUpgradeException the OpenNMS upgrade exception */ public ServiceConfig1701MigratorOffline() throws OnmsUpgradeException { super(); try { configFile = ConfigFileConstants.getFile(ConfigFileConstants.SERVICE_CONF_FILE_NAME); } catch (final IOException e) { throw new OnmsUpgradeException("Can't find Services Configuration file", e); } }
/** * <p>reload</p> * * @throws java.io.IOException if any. * @throws java.io.FileNotFoundException if any. */ public void reload() throws IOException, FileNotFoundException { m_pathsConfFile = ConfigFileConstants.getFile(ConfigFileConstants.DESTINATION_PATHS_CONF_FILE_NAME); InputStream configIn = new FileInputStream(m_pathsConfFile); m_lastModified = m_pathsConfFile.lastModified(); parseXML(configIn); configIn.close(); }
public JdbcDataCollectionConfigFactory() { try { File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.JDBC_COLLECTION_CONFIG_FILE_NAME); LOG.debug("init: config file path: {}", cfgFile.getPath()); InputStream reader = new FileInputStream(cfgFile); unmarshall(reader); reader.close(); } catch(IOException e) { // TODO rethrow. } }
/** * Reload the config from the default config file * * @throws java.io.IOException Thrown if the specified config file cannot be * read/loaded */ public synchronized void reload() throws IOException { File configFile = ConfigFileConstants.getFile(ConfigFileConstants.SYSLOGD_CONFIG_FILE_NAME); m_config = JaxbUtils.unmarshal(SyslogdConfiguration.class, new FileSystemResource(configFile)); parseIncludedFiles(); }
/** * Private constructor * * @throws java.io.IOException Thrown if the specified config file cannot be read */ public SyslogdConfigFactory() throws IOException { initExtensions(); File configFile = ConfigFileConstants.getFile(ConfigFileConstants.SYSLOGD_CONFIG_FILE_NAME); m_config = JaxbUtils.unmarshal(SyslogdConfiguration.class, new FileSystemResource(configFile)); parseIncludedFiles(); }
/** * Parses the KSC_PerformanceReport.xml * * @throws java.io.IOException if any. * @throws java.io.FileNotFoundException if any. */ public synchronized void reload() throws IOException, FileNotFoundException { if (s_configFile == null) s_configFile = ConfigFileConstants.getFile(ConfigFileConstants.KSC_REPORT_FILE_NAME); m_config = JaxbUtils.unmarshal(ReportsList.class, new FileSystemResource(s_configFile)); setIdsOnAllReports(); m_reportList = createReportList(); }