private String readFromStream(InputStream stream) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(stream));
		String line = null;
		boolean first = true;
		StringBuilder out = new StringBuilder();
		while ((line = in.readLine()) != null) {
			if (first) {
				first = false;
			} else {
				out.append(System.getProperty("line.separator"));
			}
			out.append(line);
		}
		return out.toString();
	}