GoogleApiClientUtil

public class GoogleApiClientUtil
extends GoogleApiClientUtilBase

java.lang.Object
   ↳ com.android.tradefed.util.gcs.GoogleApiClientUtilBase
     ↳ com.android.tradefed.util.GoogleApiClientUtil


Tiện ích để tạo ứng dụng API của Google.

Tóm tắt

Hàm khởi tạo công khai

GoogleApiClientUtil()

Phương thức công khai

static Credentials createCredential(Collection<String> scopes, File primaryKeyFile, String hostOptionKeyFileName, File... backupKeyFiles)

Hãy thử tạo thông tin đăng nhập bằng các tệp khoá khác hoặc từ máy chủ lưu trữ cục bộ.

static Credentials createCredential(Collection<String> scopes, boolean useCredentialFactory, File primaryKeyFile, String hostOptionKeyFileName, File... backupKeyFiles)

Hãy thử tạo thông tin đăng nhập bằng các tệp khoá khác hoặc từ máy chủ lưu trữ cục bộ.

Hàm khởi tạo công khai

GoogleApiClientUtil

public GoogleApiClientUtil ()

Phương thức công khai

createCredential

public static Credentials createCredential (Collection<String> scopes, 
                File primaryKeyFile, 
                String hostOptionKeyFileName, 
                File... backupKeyFiles)

Hãy thử tạo thông tin đăng nhập bằng các tệp khoá khác hoặc từ máy chủ lưu trữ cục bộ.

1. Nếu primaryKeyFile được đặt, hãy thử dùng tệp này để tạo thông tin đăng nhập. 2. Hãy thử lấy các tệp khoá tương ứng từ HostOptions. 3. Hãy thử sử dụng tệp khoá dự phòng. 4. Sử dụng thông tin đăng nhập mặc định cục bộ.

Tham số
scopes Collection: phạm vi cho thông tin đăng nhập.

primaryKeyFile File: tệp khoá json chính; có thể là giá trị rỗng.

hostOptionKeyFileName String: Khoá HostOptions"service-account-json-key-file option"; khoá này có thể là giá trị rỗng.

backupKeyFiles File: tệp khoá dự phòng.

Giá trị trả về
Credentials Credential

Gửi
java.io.IOException
java.security.GeneralSecurityException
GeneralSecurityException
IOException

createCredential

public static Credentials createCredential (Collection<String> scopes, 
                boolean useCredentialFactory, 
                File primaryKeyFile, 
                String hostOptionKeyFileName, 
                File... backupKeyFiles)

Hãy thử tạo thông tin đăng nhập bằng các tệp khoá khác hoặc từ máy chủ lưu trữ cục bộ.

1. Sử dụng ICredentialFactory nếu useCredentialFactory là true và bạn đã định cấu hình ICredentialFactory. Nếu primaryKeyFile được đặt, hãy thử dùng tệp này để tạo thông tin đăng nhập. 2. Hãy thử lấy các tệp khoá tương ứng từ HostOptions. 3. Hãy thử sử dụng các tệp khoá dự phòng. 4. Sử dụng thông tin đăng nhập mặc định của địa phương.

Tham số
scopes Collection: phạm vi cho thông tin đăng nhập.

useCredentialFactory boolean: sử dụng nhà máy thông tin đăng nhập nếu được định cấu hình.

primaryKeyFile File: tệp khoá json chính; có thể là giá trị rỗng.

hostOptionKeyFileName String: Khoá HostOptions"service-account-json-key-file option"; khoá này có thể là giá trị rỗng.

backupKeyFiles File: tệp khoá dự phòng.

Giá trị trả về
Credentials Credential

Gửi
java.io.IOException
java.security.GeneralSecurityException
GeneralSecurityException
IOException