code: private static String streamToString(InputStream is) {
          java.util.Scanner s = new java.util.Scanner(is, "UTF-8").useDelimiter("\\A");
          return s.hasNext() ? s.next() : "";
      }
docs: Convert an InputStream into a String object. Method taken from http://stackoverflow.com/a/5445161/521535
  
  @param is The stream to be converted
  @return The resulting String