List of usage examples for java.lang System getenv
public static String getenv(String name)
From source file:au.org.ala.delta.directives.InputDeltaFile.java
private File lookInDELTADirectory(String fileName) { String deltaDir = System.getenv(DELTA_ENV_VARIABLE); if (StringUtils.isBlank(deltaDir)) { deltaDir = "DELTA"; }//w w w . j a va 2s . c o m return new File(FilenameUtils.concat(deltaDir, fileName)); }
From source file:it.grid.storm.griduser.LcmapsJNAMapper.java
/** * @return/*from ww w.j a va 2 s . co m*/ */ private String getLcmapsLogFile() { String lcmaps_log_file = System.getenv(LCMAPS_LOG_FILE_PATH_ENV_VARIABLE); if (lcmaps_log_file == null) { lcmaps_log_file = LCMAPS_DEFAULT_LOG_FILE; } return lcmaps_log_file.trim(); }
From source file:ch.astina.hesperid.web.services.systemenvironment.impl.SystemEnvironmentImpl.java
@Override public String getEnvironmentVariableValue(String environmentVariableName) { try {/*from www. ja va 2s .c o m*/ // check if property is set return System.getProperty(environmentVariableName); } catch (Exception e) { // property is not set } try { // check if environment variable is set return System.getenv(environmentVariableName); } catch (Exception e) { // environment variable is not set } return null; }
From source file:com.capside.pokemondemo.PokemonCtrl.java
@RequestMapping(value = "/", method = RequestMethod.GET, produces = { MediaType.TEXT_HTML_VALUE }) String index(Map<String, Object> model) { String host = System.getenv("HOST") == null ? "dev" : System.getenv("HOST"); model.put("host", host); model.put("pokemon", pokemon); Set<Map.Entry<String, String>> env = System.getenv().entrySet(); model.put("env", env); model.put("task", System.getenv().get("MESOS_TASK_ID")); return "index"; }
From source file:com.yfiton.notifiers.email.EmailNotifierTest.java
@Test public void testGmail() throws MessagingException, ConfigurationException, ParameterException { // https://www.google.com/settings/security/lesssecureapps testSendEmail("gmail", "imap.gmail.com", System.getenv("GMAIL_EMAIL"), System.getenv("GMAIL_USERNAME"), System.getenv("GMAIL_PASSWORD")); }
From source file:es.bsc.servicess.ide.Logger.java
/** * Logger constructor/*from w w w . j ava 2 s .co m*/ * @param className */ public Logger(Class className) { this.className = className; this.log = Activator.getDefault().getLog(); try { String strLevel = new IDEProperties(System.getenv("HOME") + "/.ide/config.properties").getLogLevel(); if (strLevel.equalsIgnoreCase(DEBUG)) { this.level = DEBUG_LEVEL; System.out.println("Log level set to DEBUG"); } else if (strLevel.equalsIgnoreCase(INFO)) { this.level = INFO_LEVEL; System.out.println("Log level set to INFO"); } else if (strLevel.equalsIgnoreCase(WARN)) { this.level = WARN_LEVEL; System.out.println("Log level set to WARN"); } else if (strLevel.equalsIgnoreCase(ERROR)) { this.level = ERROR_LEVEL; System.out.println("Log level set to ERROR"); } } catch (Exception e) { this.level = WARN_LEVEL; System.out.println("Log level set to WARN"); } }
From source file:io.fabric8.gateway.apiman.FileBackedRegistry.java
public static File getRegistryFile() throws IOException { if (registryFile == null) { String appDir = null;//from w ww . ja v a 2 s . c o m //1. Jube - Check if System param APP_BASE exists if (System.getenv("APP_BASE") != null) { appDir = System.getenv("APP_BASE"); } else if (System.getProperty("APP_BASE") != null) { appDir = System.getProperty("APP_BASE"); } //2. Kube&Docker - File mavenDir = new File("/maven"); if (mavenDir.exists()) appDir = mavenDir.getAbsolutePath(); //3. Fall back to using the user's home directory if not Jube or Kube if (appDir == null) { appDir = System.getProperty("user.home"); LOG.info("Cannot find 'APP_BASE' system param or '/maven' dir," + " defaulting to user's home dir " + appDir); } File apiManDataDir = new File(appDir + "/data/apiman"); if (!apiManDataDir.exists()) { apiManDataDir.mkdirs(); } registryFile = new File(apiManDataDir.getAbsolutePath() + "/registry.json"); if (!registryFile.exists()) { LOG.info("Creating new APIMan JSON Datafile " + registryFile.getAbsolutePath()); registryFile.createNewFile(); } LOG.info("ApiMan is using data file " + registryFile.getAbsolutePath()); } return registryFile; }
From source file:com.github.trask.sandbox.mail.GmailServiceTest.java
@Before public void before() throws Exception { preExistingThreads = ThreadChecker.currentThreadList(); String popGmailUsername = System.getenv("POP_GMAIL_USERNAME"); String popGmailPassword = System.getenv("POP_GMAIL_PASSWORD"); popClient = new PopGmailClient(popGmailUsername, popGmailPassword); popClient.pop();//from w ww . j a v a 2s. c om executorService = new SameThreadScheduledExecutorService(); String gmailUsername = System.getenv("GMAIL_USERNAME"); String gmailPassword = System.getenv("GMAIL_PASSWORD"); mailService = new GmailService(gmailUsername, gmailPassword, executorService); }
From source file:org.cleverbus.core.common.spring.SystemExcludeRegexPatternTypeFilter.java
public SystemExcludeRegexPatternTypeFilter() { String regex = System.getenv(PATTERN_PROP_NAME); if (System.getProperty(PATTERN_PROP_NAME) != null) { regex = System.getProperty(PATTERN_PROP_NAME); }/*from ww w . ja v a 2 s. c o m*/ // compile pattern if (regex != null) { this.pattern = Pattern.compile(regex); } }
From source file:com.thoughtworks.cruise.context.configuration.TfsConfiguration.java
protected void postProcess(CruiseConfigDom dom) throws Exception { String tfsPassword = System.getenv("TFS_SERVER_PASSWORD"); if (StringUtils.isBlank(tfsPassword)) throw new RuntimeException(String.format("%s is not set", tfsPassword)); for (String pipeline : dom.getPipelineNames()) { dom.getMaterial(pipeline, "tfs_mat").attribute("password").setValue(tfsPassword); }/*from w w w. j a v a 2 s . c o m*/ }