public ProvideSystemProperty and(String name, String value) { addProperty(name, value); return this; }
@Override protected void before() throws Throwable { setProperties(); }
private static ProvideSystemProperty fromInputStream(InputStream is) throws IOException { Properties p = new Properties(); p.load(is); ProvideSystemProperty rule = new ProvideSystemProperty(); for (Map.Entry<Object, Object> property : p.entrySet()) rule.addProperty((String) property.getKey(), (String) property.getValue()); return rule; }
public static ProvideSystemProperty fromResource(String name) throws IOException { InputStream is = ProvideSystemProperty.class.getResourceAsStream(name); return fromInputStream(is); }
private void setProperties() { for (Entry<String, String> property : properties.entrySet()) { String name = property.getKey(); String value = property.getValue(); setProperty(name, value); } }
private static ProvideSystemProperty fromInputStream(InputStream is) throws IOException { Properties p = new Properties(); p.load(is); ProvideSystemProperty rule = new ProvideSystemProperty(); for (Map.Entry<Object, Object> property : p.entrySet()) rule.addProperty((String) property.getKey(), (String) property.getValue()); return rule; }
public static ProvideSystemProperty fromFile(String name) throws IOException { FileInputStream fis = new FileInputStream(name); return fromInputStream(fis); }
private void setProperties() { for (Entry<String, String> property : properties.entrySet()) { String name = property.getKey(); String value = property.getValue(); setProperty(name, value); } }
private static ProvideSystemProperty fromInputStream(InputStream is) throws IOException { Properties p = new Properties(); p.load(is); ProvideSystemProperty rule = new ProvideSystemProperty(); for (Map.Entry<Object, Object> property : p.entrySet()) rule.addProperty((String) property.getKey(), (String) property.getValue()); return rule; }
public static ProvideSystemProperty fromResource(String name) { InputStream is = ProvideSystemProperty.class.getResourceAsStream(name); try { return fromInputStream(is); } catch (IOException e) { throw new IllegalArgumentException( "Cannot create ProvideSystemProperty rule because resource \"" + name + "\" cannot be read.", e); } }
public ProvideSystemProperty and(String name, String value) { addProperty(name, value); return this; }
@Override protected void before() throws Throwable { setProperties(); }
private void setProperties() { for (Entry<String, String> property : properties.entrySet()) { String name = property.getKey(); String value = property.getValue(); setProperty(name, value); } }
public static ProvideSystemProperty fromFile(String name) { try { FileInputStream fis = new FileInputStream(name); return fromInputStream(fis); } catch (IOException e) { throw new IllegalArgumentException( "Cannot create ProvideSystemProperty rule because file \"" + name + "\" cannot be read.", e); } }
public ProvideSystemProperty(String name, String value) { addProperty(name, value); }
@Override protected void before() throws Throwable { setProperties(); }
public static ProvideSystemProperty fromResource(String name) { InputStream is = ProvideSystemProperty.class.getResourceAsStream(name); try { return fromInputStream(is); } catch (IOException e) { throw new IllegalArgumentException( "Cannot create ProvideSystemProperty rule because resource \"" + name + "\" cannot be read.", e); } }
public ProvideSystemProperty and(String name, String value) { addProperty(name, value); return this; }
public static ProvideSystemProperty fromFile(String name) { try { FileInputStream fis = new FileInputStream(name); return fromInputStream(fis); } catch (IOException e) { throw new IllegalArgumentException( "Cannot create ProvideSystemProperty rule because file \"" + name + "\" cannot be read.", e); } }
public ProvideSystemProperty(String name, String value) { addProperty(name, value); }