com.aliyun.oss.common.auth

## 类 ProfileConfigFile

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

-     public class ProfileConfigFile
      extends Object

  Loads the local OSS credential profiles from the standard location (~/.oss/credentials), which can be easily overridden through the `OSS_CREDENTIAL_PROFILES_FILE` environment variable or by specifying an alternate credentials file location through this class' constructor.

  The OSS credentials file format allows you to specify multiple profiles, each with their own set of OSS security credentials:

       [default]
       oss_access_key_id=testAccessKey
       oss_secret_access_key=testSecretKey
       oss_session_token=testSessionToken

  These credential profiles allow you to share multiple sets of OSS security credentails between different tools such as the OSS SDK for Java and the OSS CLI.

- - ### 构造器概要

    构造器
    构造器和说明
    `ProfileConfigFile(File file)` Loads the OSS credential profiles from the file.
    `ProfileConfigFile(File file, ProfileConfigLoader profileLoader)` Loads the OSS credential profiles from the file.
    `ProfileConfigFile(String filePath)` Loads the OSS credential profiles from the file.
    `ProfileConfigFile(String filePath, ProfileConfigLoader profileLoader)` Loads the OSS credential profiles from the file.

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `Credentials` | `getCredentials()` Returns the OSS credentials for the specified profile.
    `void` | `refresh()` Reread data from disk.

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

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

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

    - #### ProfileConfigFile

          public ProfileConfigFile(String filePath)

      Loads the OSS credential profiles from the file. The path of the file is specified as a parameter to the constructor.

    - #### ProfileConfigFile

          public ProfileConfigFile(String filePath,
                           ProfileConfigLoader profileLoader)

      Loads the OSS credential profiles from the file. The path of the file is specified as a parameter to the constructor.

    - #### ProfileConfigFile

          public ProfileConfigFile(File file)

      Loads the OSS credential profiles from the file. The reference to the file is specified as a parameter to the constructor.

    - #### ProfileConfigFile

          public ProfileConfigFile(File file,
                           ProfileConfigLoader profileLoader)

      Loads the OSS credential profiles from the file. The reference to the file is specified as a parameter to the constructor.

  - ### 方法详细资料

    - #### getCredentials

          public Credentials getCredentials()

      Returns the OSS credentials for the specified profile.

    - #### refresh

          public void refresh()

      Reread data from disk.

Copyright © 2020. All Rights Reserved.