• 大小: 5.13MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-06
  • 语言: Java
  • 标签: google  oauth2.0  java  

资源简介

一套完整的 google drive 认证系统,可以根据以下命令编译运行: 将申请的Client ID和Client secrets加入到client_secrets.json cd . (当前源码根路径) mkdir bin dir /b/s src\*.java > src.list javac -sourcepath src -d bin -classpath "lib/*;" @src.list copy client_secrets.json bin\ java -classpath "bin;lib/*;" com.google.oauth2.Oauth2

资源截图

代码片段和文件信息

/*
 * Copyright (c) 2012 Google Inc.
 *
 * Licensed under the Apache License Version 2.0 (the “License“); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing software distributed under the License
 * is distributed on an “AS IS“ BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.api.client.extensions.java6.auth.oauth2;

import java.util.Scanner;

/**
 * OAuth 2.0 abstract verification code receiver that prompts user to paste the code copied from the
 * browser.
 *
 * 


 * Implementation is thread-safe.
 * 


 *
 * @since 1.11
 * @author Yaniv Inbar
 */
public abstract class AbstractPromptReceiver implements VerificationCodeReceiver {

  @SuppressWarnings(“resource“)
  @Override
  public String waitForCode() {
    String code;
    do {
      System.out.print(“Please enter code: “);
      code = new Scanner(System.in).nextLine();
    } while (code.isEmpty());
    return code;
  }

  @Override
  public void stop() {
  }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-12-06 14:27  lib\
     文件       60686  1980-01-01 00:00  lib\commons-logging-1.1.1.jar
     文件      199010  1980-01-01 00:00  lib\google-api-client-1.22.0.jar
     文件          57  1980-01-01 00:00  lib\google-api-client-1.22.0.jar.properties
     文件       10314  1980-01-01 00:00  lib\google-api-client-android-1.22.0.jar
     文件          65  1980-01-01 00:00  lib\google-api-client-android-1.22.0.jar.properties
     文件        9888  1980-01-01 00:00  lib\google-api-client-appengine-1.22.0.jar
     文件        2651  1980-01-01 00:00  lib\google-api-client-gson-1.22.0.jar
     文件          78  2016-05-02 16:44  lib\google-api-client-gson-1.22.0.jar.properties
     文件        2694  1980-01-01 00:00  lib\google-api-client-jackson2-1.22.0.jar
     文件          82  2016-05-02 16:44  lib\google-api-client-jackson2-1.22.0.jar.properties
     文件        2345  1980-01-01 00:00  lib\google-api-client-java6-1.22.0.jar
     文件       10641  2016-05-02 16:44  lib\google-api-client-protobuf-1.22.0.jar
     文件          66  2016-05-02 16:44  lib\google-api-client-protobuf-1.22.0.jar.properties
     文件        6590  1980-01-01 00:00  lib\google-api-client-servlet-1.22.0.jar
     文件       10369  2016-05-02 16:44  lib\google-api-client-xml-1.22.0.jar
     文件          61  2016-05-02 16:44  lib\google-api-client-xml-1.22.0.jar.properties
     文件       97555  1980-01-01 00:00  lib\google-api-services-drive-v3-rev52-1.22.0.jar
     文件          74  1980-01-01 00:00  lib\google-api-services-drive-v3-rev52-1.22.0.jar.properties
     文件      356261  1980-01-01 00:00  lib\google-http-client-1.22.0.jar
     文件          58  1980-01-01 00:00  lib\google-http-client-1.22.0.jar.properties
     文件       12013  1980-01-01 00:00  lib\google-http-client-android-1.22.0.jar
     文件          66  1980-01-01 00:00  lib\google-http-client-android-1.22.0.jar.properties
     文件       15554  1980-01-01 00:00  lib\google-http-client-appengine-1.22.0.jar
     文件        8496  1980-01-01 00:00  lib\google-http-client-gson-1.22.0.jar
     文件          63  1980-01-01 00:00  lib\google-http-client-gson-1.22.0.jar.properties
     文件        6033  2016-05-02 16:44  lib\google-http-client-jackson-1.22.0.jar
     文件          66  2016-05-02 16:44  lib\google-http-client-jackson-1.22.0.jar.properties
     文件        6672  1980-01-01 00:00  lib\google-http-client-jackson2-1.22.0.jar
     文件          67  1980-01-01 00:00  lib\google-http-client-jackson2-1.22.0.jar.properties
     文件       11225  1980-01-01 00:00  lib\google-http-client-jdo-1.22.0.jar
............此处省略50个文件信息

评论

共有 条评论