private String getStringFromReader(Reader reader) throws IOException {
        StringBuffer sb = new StringBuffer();
        if(reader != null){
            BufferedReader bufferedReader = new BufferedReader(reader);
            while(bufferedReader.readLine() != null) {
                sb.append(bufferedReader.readLine());
            }
        }
        return sb.toString();
    }