Here you can find the source of loadProperties(String properties)
public static Properties loadProperties(String properties) throws IOException
//package com.java2s; /******************************************************************************* * * Copyright (c) 2004-2011 Oracle Corporation. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: //w ww . j a v a 2s. c om * * Kohsuke Kawaguchi, Winston Prakash * * *******************************************************************************/ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.StringReader; import java.util.Properties; public class Main { /** * Loads a key/value pair string as {@link Properties} * @since 1.392 */ public static Properties loadProperties(String properties) throws IOException { Properties p = new Properties(); try { p.load(new StringReader(properties)); } catch (NoSuchMethodError e) { // load(Reader) method is only available on JDK6. // this fall back version doesn't work correctly with non-ASCII characters, // but there's no other easy ways out it seems. p.load(new ByteArrayInputStream(properties.getBytes())); } return p; } }