Java examples for java.io:Properties
Create Properties from String
//package com.java2s; import java.io.*; import java.util.*; public class Main { public static void main(String[] argv) { String props = "java2s.com"; System.out.println(toProperties(props)); }//from ww w. j a v a 2s . c o m @SuppressWarnings("deprecation") public static Properties toProperties(String props) { Properties p = new Properties(); StringBufferInputStream sbi = new StringBufferInputStream(props); try { p.load(sbi); } catch (IOException e) { throw new RuntimeException( "Unexpected Exception Converting String to Properties", e); } return p; } }