Here you can find the source of parseProperties(final String string)
public static Properties parseProperties(final String string)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Properties parseProperties(final String string) { final Properties properties = new Properties(); final int len = string.length(); String key = null;/*from www. j a v a2 s . com*/ int index = 0; while (true) { final int newIndex = string.indexOf('=', index); if (newIndex < 0) { if (key != null && len > index) { properties.setProperty(key, string.substring(index, len).trim()); } break; } int end = newIndex - 1; while (end >= 0 && Character.isWhitespace(string.charAt(end))) { --end; } if (end > 0) { int start = end; while (start > 0 && !Character.isWhitespace(string.charAt(start - 1))) { --start; } if (key != null && start > index) { properties.setProperty(key, string.substring(index, start).trim()); } key = string.substring(start, end + 1); } index = newIndex + 1; } return properties; } }