com.aliyun.oss.common.auth

## 类 ProfileCredentialsProvider

- java.lang.Object
- - com.aliyun.oss.common.auth.ProfileCredentialsProvider

- 所有已实现的接口:
    CredentialsProvider

      public class ProfileCredentialsProvider
      extends Object
      implements CredentialsProvider

  Credentials provider based on OSS configuration profiles. This provider vends Credentials from the profile configuration file for the default profile, or for a specific, named profile. The OSS credentials file locates at ~/.oss/credentials on Linux, macOS, or Unix, or at C:\Users\USERNAME \.oss\credentials on Windows. This file can contain multiple named profiles in addition to a default profile.

- - ### 构造器概要

    构造器
    构造器和说明
    `ProfileCredentialsProvider()` Creates a new profile credentials provider that returns the OSS security credentials configured for the default profile.
    `ProfileCredentialsProvider(ProfileConfigFile profilesConfigFile, String profileName)` Creates a new profile credentials provider that returns the OSS security credentials for the specified profiles configuration file and profile name.
    `ProfileCredentialsProvider(String profileName)` Creates a new profile credentials provider that returns the OSS security credentials configured for the named profile.
    `ProfileCredentialsProvider(String profilesConfigFilePath, String profileName)` Creates a new profile credentials provider that returns the OSS security credentials for the specified profiles configuration file and profile name.

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `Credentials` | `getCredentials()`
    `long` | `getRefreshForceIntervalMillis()` Gets the forced refresh interval in milliseconds.
    `long` | `getRefreshIntervalMillis()` Gets the refresh interval in milliseconds.
    `void` | `refresh()`
    `void` | `setCredentials(Credentials creds)`
    `void` | `setRefreshForceIntervalMillis(long refreshForceIntervalMillis)` Sets the forced refresh interval in milliseconds.
    `void` | `setRefreshIntervalNanos(long refreshIntervalMillis)` Sets the refresh interval in milliseconds.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### ProfileCredentialsProvider

          public ProfileCredentialsProvider()

      Creates a new profile credentials provider that returns the OSS security credentials configured for the default profile. Loading the credential file is deferred until the getCredentials() method is called.

    - #### ProfileCredentialsProvider

          public ProfileCredentialsProvider(String profileName)

      Creates a new profile credentials provider that returns the OSS security credentials configured for the named profile. Loading the credential file is deferred until the getCredentials() method is called.
      参数:
        `profileName` - The name of a local configuration profile.

    - #### ProfileCredentialsProvider

          public ProfileCredentialsProvider(String profilesConfigFilePath,
                                    String profileName)

      Creates a new profile credentials provider that returns the OSS security credentials for the specified profiles configuration file and profile name.
      参数:
        `profilesConfigFilePath` - The file path where the profile configuration file is located.
        `profileName` - The name of a configuration profile in the specified configuration file.

    - #### ProfileCredentialsProvider

          public ProfileCredentialsProvider(ProfileConfigFile profilesConfigFile,
                                    String profileName)

      Creates a new profile credentials provider that returns the OSS security credentials for the specified profiles configuration file and profile name.
      参数:
        `profilesConfigFile` - The profile configuration file containing the profiles used by this credentials provider or null to defer load to first use.
        `profileName` - The name of a configuration profile in the specified configuration file.

  - ### 方法详细资料

    - #### setCredentials

          public void setCredentials(Credentials creds)

      指定者:
        `setCredentials` 在接口中 `CredentialsProvider`

    - #### getCredentials

          public Credentials getCredentials()

      指定者:
        `getCredentials` 在接口中 `CredentialsProvider`

    - #### refresh

          public void refresh()

    - #### getRefreshIntervalMillis

          public long getRefreshIntervalMillis()

      Gets the refresh interval in milliseconds.
      返回:
        milliseconds

    - #### setRefreshIntervalNanos

          public void setRefreshIntervalNanos(long refreshIntervalMillis)

      Sets the refresh interval in milliseconds.
      参数:
        `refreshIntervalMillis` - milliseconds.

    - #### getRefreshForceIntervalMillis

          public long getRefreshForceIntervalMillis()

      Gets the forced refresh interval in milliseconds.
      返回:
        milliseconds.

    - #### setRefreshForceIntervalMillis

          public void setRefreshForceIntervalMillis(long refreshForceIntervalMillis)

      Sets the forced refresh interval in milliseconds.
      参数:
        `refreshForceIntervalMillis` - milliseconds.

Copyright © 2020. All Rights Reserved.