Here you can find the source of propertiesToString(Properties props)
Properties
and converts it to a String.
public static String propertiesToString(Properties props) throws Exception
//package com.java2s; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Properties; public class Main { /**//from ww w. ja va2 s . co m * Receives a <code>Properties</code> and converts it * to a String. */ public static String propertiesToString(Properties props) throws Exception { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); props.store(printWriter, null); String s = stringWriter.toString(); s = s.substring(s.indexOf("\n") + 1); return s; } }