/** * Cache the system properties and set the system properties to the * new values. * @throws BuildException if Security prevented this operation. */ public void setSystem() throws BuildException { try { sys = System.getProperties(); Properties p = new Properties(); for (String name : sys.stringPropertyNames()) { String value = sys.getProperty(name); if (value != null) { p.put(name, value); } } p.putAll(mergePropertySets()); for (Environment.Variable v : variables) { v.validate(); p.put(v.getKey(), v.getValue()); } System.setProperties(p); } catch (SecurityException e) { throw new BuildException("Cannot modify system properties", e); } }
List<String> nonexistent_sysprops = new ArrayList<String>(); // keys that didn't exist in system properties for (Environment.Variable env_var : sysProps) { String old_value = System.setProperty(env_var.getKey(), env_var.getValue()); if (old_value == null) { nonexistent_sysprops.add(env_var.getKey());
List<String> nonexistent_sysprops = new ArrayList<String>(); // keys that didn't exist in system properties for (Environment.Variable env_var : sysProps) { String old_value = System.setProperty(env_var.getKey(), env_var.getValue()); if (old_value == null) { nonexistent_sysprops.add(env_var.getKey());
channel.setEnv(env.getKey(), env.getValue());
System.setProperty("java.io.tmpdir", var.getValue());
String tempDir = commandline.getSystemProperties().getVariablesVector().stream() .filter(v -> v.getKey().equals("java.io.tmpdir")) .map(v -> v.getValue()) .findAny() .orElse(null);
String tempDir = commandline.getSystemProperties().getVariablesVector().stream() .filter(v -> v.getKey().equals("java.io.tmpdir")) .map(v -> v.getValue()) .findAny() .orElse(null);
private void setupDefines() { org.apache.tools.ant.types.Environment.Variable prop; String value; for (int i = 0; i < _defines.size(); i++) { prop = (org.apache.tools.ant.types.Environment.Variable) _defines.get(i); value = prop.getValue(); if (value == null) value = "1"; lexer.define(prop.getKey(), value); } /* Standard compiler defines, can be undefined */ lexer.define("JACORB", "1"); lexer.define("_PRE_3_0_COMPILER_", "1"); lexer.define("GIOP_1_1", "1"); lexer.define("GIOP_1_2", "1"); for (int i = 0; i < _undefines.size(); i++) { prop = (org.apache.tools.ant.types.Environment.Variable) _undefines.get(i); lexer.undefine(prop.getKey()); } } }
private void setupDefines() { org.apache.tools.ant.types.Environment.Variable prop; String value; for (int i = 0; i < _defines.size(); i++) { prop = (org.apache.tools.ant.types.Environment.Variable) _defines.get(i); value = prop.getValue(); if (value == null) value = "1"; lexer.define(prop.getKey(), value); } /* Standard compiler defines, can be undefined */ lexer.define("JACORB", "1"); lexer.define("_PRE_3_0_COMPILER_", "1"); lexer.define("GIOP_1_1", "1"); lexer.define("GIOP_1_2", "1"); for (int i = 0; i < _undefines.size(); i++) { prop = (org.apache.tools.ant.types.Environment.Variable) _undefines.get(i); lexer.undefine(prop.getKey()); } } }
@Override public void addSysproperty(Variable sysp) { if (sysp.getKey().startsWith("sshjava.shift.")) { shiftMap.put(sysp.getKey().replaceFirst("sshjava.shift.", ""), sysp.getValue()); } else if (sysp.getKey().startsWith("sshjava.replace.")) { replace.put(sysp.getKey().replaceFirst("sshjava.replace.", ""), sysp.getValue()); } else if (sysp.getKey().equals("sshjava.id")) { setId(sysp.getValue()); } else if (sysp.getKey().equals("sshjava.host")) { setHost(sysp.getValue()); } else if (sysp.getKey().equals("sshjava.port") && !sysp.getValue().equals("")) { setPort(Integer.parseInt(sysp.getValue())); } else if (sysp.getKey().equals("sshjava.username")) { setUsername(sysp.getValue()); } else if (sysp.getKey().equals("sshjava.password") && !sysp.getValue().equals("")) { setPassword(sysp.getValue()); } else if (sysp.getKey().equals("sshjava.keyfile") && !sysp.getValue().equals("")) { setKeyfile(sysp.getValue()); } else if (sysp.getKey().equals("sshjava.remotebase")) { setRemotebase(new File(sysp.getValue())); } else { super.addSysproperty(sysp); } }
private void setupDefines() { org.apache.tools.ant.types.Environment.Variable prop; String value; for (int i = 0; i < _defines.size(); i++) { prop = (org.apache.tools.ant.types.Environment.Variable) _defines.get(i); value = prop.getValue(); if (value == null) value = "1"; lexer.define(prop.getKey(), value); } for (int i = 0; i < _undefines.size(); i++) { prop = (org.apache.tools.ant.types.Environment.Variable) _undefines.get(i); lexer.undefine(prop.getKey()); } } }
public void addConfiguredProperty(Environment.Variable property) { properties.put(property.getKey(), property.getValue()); }
public void addConfiguredProperty(Environment.Variable property) { properties.put(property.getKey(), property.getValue()); }
public void addConfiguredProperty(Environment.Variable property) { properties.put(property.getKey(), property.getValue()); }
public void addConfiguredProperty(Environment.Variable property) { properties.put(property.getKey(), property.getValue()); }
/** * Adds a system property that will be set up in the executing container VM. * * @param property the system property to add */ public void addSysproperty(Environment.Variable property) { getSystemProperties().put(property.getKey(), property.getValue()); }
/** * Sets a property for the Pack200 packer. */ public void addConfiguredProperty(Environment.Variable prop) { prop.validate(); properties.put(prop.getKey(), prop.getValue()); }
/** * Adds a system property that will be set up in the executing container VM. * * @param property the system property to add */ public void addSysproperty(Environment.Variable property) { getSystemProperties().put(property.getKey(), property.getValue()); }
/** * Sets a property for the Pack200 unpacker. */ public void addConfiguredProperty(Environment.Variable prop) { prop.validate(); properties.put(prop.getKey(), prop.getValue()); }
/** * Sets a property for the Pack200 packer. */ public void addConfiguredProperty(Environment.Variable prop) { prop.validate(); properties.put(prop.getKey(), prop.getValue()); }