/** * Convert String into Properties. */ public void setAsText(String text) throws IllegalArgumentException { if (text == null) { throw new IllegalArgumentException("Cannot set Properties to null"); } Properties props = new Properties(); try { props.load(new ByteArrayInputStream(text.getBytes())); dropComments(props); } catch (IOException ex) { // shouldn't happen throw new IllegalArgumentException("Failed to parse [" + text + "] into Properties"); } setValue(props); }