Package com.google.api.client.json.gson

Examples of com.google.api.client.json.gson.GsonFactory


  private final static String CLIENT_SECRETS = "{\"installed\": {\"client_id\": \"" + CLIENT_ID
      + "\",\"client_secret\": \"" + CLIENT_SECRET + "\"}}";

  public void testLoad() throws Exception {
    GoogleClientSecrets clientSecrets =
        GoogleClientSecrets.load(new GsonFactory(), new StringReader(CLIENT_SECRETS));
    Details installed = clientSecrets.getInstalled();
    assertNotNull(installed);
    assertEquals(CLIENT_ID, installed.getClientId());
    assertEquals(CLIENT_SECRET, installed.getClientSecret());
  }
View Full Code Here


    this.clientTokenPath = Paths.get(googleDriveOptions.getClientTokenPath());

    try {
      final String clientTokenAsJson = Files.exists(this.clientTokenPath) ? FileUtils.readFileToString(this.clientTokenPath.toFile()) : null;

      credential = new GoogleCredential.Builder().setTransport(new NetHttpTransport()).setJsonFactory(new GsonFactory())
          .setClientSecrets(googleDriveOptions.getClientID(), googleDriveOptions.getClientSecret()).build();

      if (StringUtils.isEmpty(clientTokenAsJson)) {

        final String url = flow.newAuthorizationUrl().setRedirectUri(REDIRECT_URL).build();
View Full Code Here

TOP

Related Classes of com.google.api.client.json.gson.GsonFactory

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.