Package com.google.refine.oauth

Examples of com.google.refine.oauth.Provider


    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       
        try {
            Provider provider = OAuthUtilities.getProvider(request);
            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
            String query = request.getParameter("query");
            String result = FreebaseUtils.mqlread(provider,query);
            response.getWriter().write(result);
View Full Code Here


    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       
        try {
            Provider provider = OAuthUtilities.getProvider(request);
           
            Credentials access_credentials = Credentials.getCredentials(request, provider, Credentials.Type.ACCESS);
           
            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
View Full Code Here

   
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       
        try {
            Provider provider = OAuthUtilities.getProvider(request);
            String user_id = request.getParameter("user_id");
            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
            String user_badges = FreebaseUtils.getUserBadges(provider, user_id);
            response.getWriter().write(user_badges);
View Full Code Here

   
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       
        try {
            Provider provider = OAuthUtilities.getProvider(request);
                       
            // this cookie should not be there, but this is good hygiene practice
            Credentials.deleteCredentials(request, response, provider, Credentials.Type.REQUEST);
           
            Credentials access_credentials = Credentials.getCredentials(request, provider, Credentials.Type.ACCESS);
View Full Code Here

        String source_id,
        String mdo_id,
        String triples
    ) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, ClientProtocolException, JSONException, IOException {
               
        Provider provider = OAuthUtilities.getProvider(FREEBASE_HOST);
       
        Credentials credentials = Credentials.getCredentials(request, provider, Credentials.Type.ACCESS);
       
        JSONObject mdo_info = new JSONObject();
        mdo_info.put("name", source_name);
View Full Code Here

       
        try {
            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
           
            Provider provider = OAuthUtilities.getProvider(request);
           
            Credentials.deleteCredentials(request, response, provider, Credentials.Type.ACCESS);
           
            respond(response, "200 OK", "");
        } catch (Exception e) {
View Full Code Here

   
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        // get the provider from the request
        Provider provider = OAuthUtilities.getProvider(request);

        try {
           
            // see if the request comes with access credentials
            Credentials access_credentials = Credentials.getCredentials(request, provider, Credentials.Type.ACCESS);
                                   
            // prepare the continuation URL that the OAuth provider will redirect the user to
            // (we need to make sure this URL points back to this code or the dance will never complete)
            String callbackURL = getBaseURL(request,provider);
           
            if (access_credentials == null) {
                // access credentials are not available so we need to check
                // to see at what stage of the OAuth dance we are
               
                // get the request token credentials
                Credentials request_credentials = Credentials.getCredentials(request, provider, Credentials.Type.REQUEST);

                OAuthConsumer consumer = OAuthUtilities.getConsumer(request_credentials, provider);
                OAuthProvider pp = provider.getProvider();
               
                if (request_credentials == null) {
                    // no credentials were found, so let's start the dance

                    // get the request token
View Full Code Here

TOP

Related Classes of com.google.refine.oauth.Provider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.