Examples of GoogleService


Examples of com.google.gdata.client.GoogleService

       
        System.out.println("[Debug Info] binding.getServiceType()" + serviceType);
        System.out.println("[Debug Info] binding.getName()" +usernane);
        System.out.println("[Debug Info] binding.getPassword()" + password);   
       
        googleService = new GoogleService(serviceType, "");
        if(binding.getUsername().equals("admin") == false && binding.getPassword().equals("admin")==false){
            googleService.setUserCredentials(binding.getUsername(),binding.getPassword());    
        }

        // Create an HTTP client
View Full Code Here

Examples of com.google.gdata.client.GoogleService

                limit,
                options,
                exceptions
            );
        } else if ("table".equals(docType)) {
            GoogleService service = GDataExtension.getFusionTablesGoogleService(token);
            parse(
                service,
                project,
                metadata,
                job,
View Full Code Here

Examples of com.google.gdata.client.GoogleService

        }
        return service;
    }
   
    static public GoogleService getFusionTablesGoogleService(String token) {
        GoogleService service = new GoogleService("fusiontables", SERVICE_APP_NAME);
        if (token != null) {
            service.setAuthSubToken(token);
        }
        return service;
    }
View Full Code Here

Examples of com.google.gdata.client.GoogleService

    }
   
    static private String uploadFusionTable(
            Project project, final Engine engine, final Properties params,
            String token, String name, List<Exception> exceptions) {
        GoogleService service = GDataExtension.getFusionTablesGoogleService(token);
        FusionTableSerializer serializer = new FusionTableSerializer(service, name, exceptions);
       
        CustomizableTabularExporterUtilities.exportRows(
                project, engine, params, serializer);
       
View Full Code Here

Examples of com.google.gdata.client.GoogleService

       
        System.out.println("[Debug Info] binding.getServiceType()" + serviceType);
        System.out.println("[Debug Info] binding.getName()" +usernane);
        System.out.println("[Debug Info] binding.getPassword()" + password);   
       
        googleService = new GoogleService(serviceType, "");
        if(binding.getUsername().equals("admin") == false && binding.getPassword().equals("admin")==false){
            googleService.setUserCredentials(binding.getUsername(),binding.getPassword());    
        }

        // Create an HTTP client
View Full Code Here

Examples of com.google.gdata.client.GoogleService

    // Initialize the variables needed to make the request
    URL feedUrl = new URL(variables.getFeedUrl());
    System.out.println("Sending request to " + feedUrl.toString());
    System.out.println();
    GoogleService googleService =
        new GoogleService(variables.getGoogleServiceName(), "oauth-sample-app");

    // Set the OAuth credentials which were obtained from the step above.
    googleService.setOAuthCredentials(oauthParameters, signer);

    // Make the request to Google
    BaseFeed resultFeed = googleService.getFeed(feedUrl, Feed.class);
    System.out.println("Response Data:");
    System.out.println("=====================================================");
    System.out.println("| TITLE: " + resultFeed.getTitle().getPlainText());
    if (resultFeed.getEntries().size() == 0) {
      System.out.println("|\tNo entries found.");
View Full Code Here

Examples of com.google.gdata.client.GoogleService

        + variables.getVariable("xoauth_requestor_id");
    URL feedUrl = new URL(feedUrlString);

    System.out.println("Sending request to " + feedUrl.toString());
    System.out.println();
    GoogleService googleService =
        new GoogleService(variables.getGoogleServiceName(),
            "2-legged-oauth-sample-app");

    // Set the OAuth credentials which were obtained from the steps above.
    googleService.setOAuthCredentials(oauthParameters, signer);

    // Make the request to Google
    BaseFeed resultFeed = googleService.getFeed(feedUrl, Feed.class);
    System.out.println("Response Data:");
    System.out.println("=====================================================");
    System.out.println("| TITLE: " + resultFeed.getTitle().getPlainText());
    if (resultFeed.getEntries().size() == 0) {
      System.out.println("|\tNo entries found.");
View Full Code Here

Examples of com.google.gdata.client.GoogleService

    if (feedUrlString == null) {
      throw new IllegalArgumentException("Must specify feed URL");
    }

    GoogleService service = new GoogleService(serviceName, appName);

    try {

      // URL of service endpoint.
      URL feedUrl = new URL(feedUrlString);

      // Set up authentication.
      if (username != null) {
        if (password == null) {
          throw new IllegalArgumentException("Must specify password");
        }
        service.setUserCredentials(username, password);
      }

      // Send the query request and receive the response.
      Feed feed = service.getFeed(feedUrl, Feed.class);

      // Print the title and update time of the returned feed.
      System.out.println("Feed title " + feed.getTitle().getPlainText() +
                         " (" + feed.getUpdated() + ")");

      // Print the title and update time and body of each entry.
      System.out.println("Entries:");
      for (Entry e : feed.getEntries()) {
        String content =
            (e.getContent() != null ?
            ((TextContent) e.getContent()).getContent().getPlainText() :
            "");
        System.out.println("  " + e.getTitle().getPlainText() +
                           " (" + e.getUpdated() + ")" +
                           (content.length() > 0 ? ": " : "") + content);
      }

      // Insert, update, and delete an entry if so requested.
      if (updateEntry) {
        BaseEntry newEntry = new Entry();
        newEntry.setTitle(new PlainTextConstruct("Sample entry title"));
        newEntry.setContent(new PlainTextConstruct("Sample entry content"));
        BaseEntry e = service.insert(feedUrl, newEntry);
        System.out.println("Inserted an entry, ID is " + e.getId());
        e.setContent(new PlainTextConstruct("New sample entry content"));
        service.update(new URL(e.getEditLink().getHref()), e);
        System.out.println("Updated the entry");
        service.delete(new URL(e.getEditLink().getHref()));
        System.out.println("Deleted the entry");
      }

    } catch (ServiceException e) {
      throw new RuntimeException(e.getMessage() + "\n" + e.getResponseBody());
View Full Code Here

Examples of com.google.gdata.client.GoogleService

    }

    service = new DocsService(applicationName);

    // Creating a spreadsheets service is necessary for downloading spreadsheets
    spreadsheetsService = new GoogleService(SPREADSHEETS_SERVICE_NAME, applicationName);

    this.host = host;
  }
View Full Code Here

Examples of com.google.gdata.client.GoogleService

       
        //System.out.println("[Debug Info] binding.getServiceType()" + serviceType);
        //System.out.println("[Debug Info] binding.getName()" +usernane);
        //System.out.println("[Debug Info] binding.getPassword()" + password);   
       
        googleService = new GoogleService(serviceType, "");
        if(binding.getUsername().equals("admin") == false && binding.getPassword().equals("admin")==false){
            googleService.setUserCredentials(binding.getUsername(),binding.getPassword());    
        }

        // Create an HTTP client
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.