Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.HashMap;

import java.util.Map;

public class Main {

    public static Map<String, String> parseOAuthResponse(String content) {
        Map<String, String> map = new HashMap<String, String>();
        if (content != null && !content.isEmpty()) {
            String[] items = content.split("&");
            for (String item : items) {
                int index = item.indexOf("=");
                String key = item.substring(0, index);
                String value = item.substring(index + 1);
                map.put(key, value);
            }
        }
        return map;
    }
}