private static void readSystemProperties(final String prefix) { final String completePrefix; if (prefix != null && !prefix.isEmpty()) { completePrefix = prefix + "."; } else { completePrefix = ""; } // Read in and apply the conf/system.properties final File conf = system.get().getConf(completePrefix + "system.properties"); if (conf != null && conf.exists()) { addSystemProperties(conf); } }
private static void readSystemProperties(final String prefix) { final String completePrefix; if (prefix != null && !prefix.isEmpty()) { completePrefix = prefix + "."; } else { completePrefix = ""; } // Read in and apply the conf/system.properties final File conf = system.getConf(completePrefix + "system.properties"); if (conf != null && conf.exists()) { addSystemProperties(conf); } }
private static Properties loadLoggingProperties() { try { final File conf = SystemInstance.get().getConf(null); final File file = new File(conf, "logging.properties"); return IO.readProperties(file); } catch (final IOException e) { return new Properties(); } }
private static Properties loadLoggingProperties() { try { final File conf = SystemInstance.get().getConf(null); final File file = new File(conf, "logging.properties"); return IO.readProperties(file); } catch (final IOException e) { return new Properties(); } }
private static Properties loadLoggingProperties() { try { final File conf = SystemInstance.get().getConf(null); final File file = new File(conf, "logging.properties"); return IO.readProperties(file); } catch (final IOException e) { return new Properties(); } }
public static File install(final URL resource, final String name, final boolean overwrite) throws IOException { if (resource == null) { return null; } final SystemInstance system = SystemInstance.get(); final File conf = system.getConf(null); if (conf != null && !conf.exists()) { return null; } final File file = new File(conf, name); if (file.exists() && !overwrite) { return file; } IO.copy(IO.read(resource), file); return file; }
public static File install(final URL resource, final String name, final boolean overwrite) throws IOException { if (resource == null) { return null; } final SystemInstance system = SystemInstance.get(); final File conf = system.getConf(null); if (conf != null && !conf.exists()) { return null; } final File file = new File(conf, name); if (file.exists() && !overwrite) { return file; } IO.copy(IO.read(resource), file); return file; }
private void preprocessProperties(final Properties properties) { final FileUtils base = SystemInstance.get().getBase(); final File confDir = SystemInstance.get().getConf(null); final File baseDir = base.getDirectory(); final File userDir = new File("foo").getParentFile();
private void preprocessProperties(final Properties properties) { final FileUtils base = SystemInstance.get().getBase(); final File confDir = SystemInstance.get().getConf(null); final File baseDir = base.getDirectory(); final File userDir = new File("foo").getParentFile();
final File exclusionsFile = SystemInstance.get().getConf(EXCLUSION_FILE); if (exclusionsFile != null && exclusionsFile.exists()) { fis = new FileInputStream(exclusionsFile);
public static Collection<File> addAdditionalLibraries() throws IOException { final File conf = SystemInstance.get().getConf(ADDITIONAL_LIB_CONFIG); if (conf == null || !conf.exists()) { return Collections.emptyList();
@PostConstruct private void loadDefault() { defaultTokenResponse = new TokenResponse(); defaultTokenResponse.load(SystemInstance.get().getConf("default-oauth2-responses.json")); LOG.info(Oauth2Codes.LOADED_BUILTIN_OAUTH_RESPONSES, "Loaded Custom OAuth Responses."); }
final File exclusionsFile = SystemInstance.get().getConf(EXCLUSION_FILE); if (exclusionsFile != null && exclusionsFile.exists()) { fis = new FileInputStream(exclusionsFile);
public static Collection<File> addAdditionalLibraries() throws IOException { final File conf = SystemInstance.get().getConf(ADDITIONAL_LIB_CONFIG); if (conf == null || !conf.exists()) { return Collections.emptyList();
public GrokUtil(String grokPattern, String grokPatternsFile) { if (grokPattern == null || grokPattern.trim().isEmpty()) { throw new IllegalArgumentException("Grok Pattern can't be null nor empty."); } LOGGER.info(ContainerCodes.GROK_PATTERN_SET, "Grok pattern set to {0}. Compiling ...", grokPattern); try { if (grokPatternsFile == null) { grokPatternsFile = SystemInstance.get().getConf("patterns").getAbsolutePath(); LOGGER.info(ContainerCodes.GROK_PATTERN_NOT_SET, "Pattern file not set. Setting to {0}", grokPatternsFile); } grok = Grok.create(grokPatternsFile); grok.compile(grokPattern); LOGGER.info(ContainerCodes.GROK_COMPILED, "Grok pattern {0} successfully compiled.", grokPattern); } catch (final GrokException e) { LOGGER.warning(ContainerCodes.GROK_CANT_COMPILE, "Can't compile Grok pattern {0}. Error is {1}. Skipping ...", grokPattern, e.getMessage()); throw new RuntimeException(e); } }
File confDir = SystemInstance.get().getConf(null); if (confDir == null) { confDir = SystemInstance.get().getBase().getDirectory("conf");
public void configure(@Observes final AssemblerCreated ignored) { final String jaasConfigurationProperty = System.getProperty(JAAS_CONF_PROPERTY); if (jaasConfigurationProperty == null) { final FileUtils base = SystemInstance.get().getBase(); LOGGER.info(SecurityCodes.CONFIGURER_JAAS_NOT_SET, "JAAS Configuration file not set. Trying to find a jaas.config file in {0} conf/ directory.", base.getDirectory().toString()); final File jaasConfFile = SystemInstance.get().getConf(DEFAULT_JAAS_CONF); if (jaasConfFile.isFile() && jaasConfFile.exists()) { System.setProperty(JAAS_CONF_PROPERTY, jaasConfFile.getAbsolutePath()); LOGGER.info(SecurityCodes.CONFIGURER_JAAS_FOUND, "JAAS Configuration file {0} found. Auto configuration done. To skip the auto configuration, " + "set system property {1}.", jaasConfFile.getAbsolutePath(), JAAS_CONF_PROPERTY); } else { LOGGER.info(SecurityCodes.CONFIGURER_JAAS_CONFIG_FAILED, "JAAS Configuration auto configuration failed. Unable to find file {0} in {1} conf/ directory.", DEFAULT_JAAS_CONF, base.getDirectory().getName() ); } } else { LOGGER.debug(SecurityCodes.CONFIGURER_JAAS_CONFIG_ALREADY_SET, "JAAS Configuration file already set to {0}. Skip auto configuration."); } } }
if (SystemInstance.get().getConf(null).exists()) { try { dir = openejbBase.getDirectory("temp");
File confDir = SystemInstance.get().getConf(null); if (confDir == null) { confDir = SystemInstance.get().getBase().getDirectory("conf");
if (SystemInstance.get().getConf(null).exists()) { try { dir = openejbBase.getDirectory("temp");