Updated on 2024-01-16 GMT+08:00

Overview (SDK for Java)

After the SDK is installed, you need to create and configure an OBS client and configure the logging for the SDK to complete the initialization.

Table 1 Initialization

Task

Sub-task

Mandatory (Yes/No)

Description

Creating and Configuring an OBS Client (SDK for Java)

Creating an OBS client

Yes

OBS clients offer a series of APIs for you to use OBS SDK for Java to interact with OBS. Before sending a request to OBS, you need to create and initialize an OBS client (an ObsClient instance).

Configuring access credentials

Yes

For security purposes, you need to configure access credentials for the client so that the server can verify the validity of requests.

Configuring the endpoint and other parameters

Yes for the endpoint; No for other parameters

  • To quickly create and retrieve your resources, you need to configure an endpoint for the client so that the server can know where to create or retrieve resources.
  • You can configure other parameters for the client based on your needs.

Configuring SDK Logging (SDK for Java)

Configuring a log level

No

OBS SDK for Java offers logging based on the open-source library of Apache Log4j 2. The Log4j 2 framework classifies log files into different levels based on their priorities. You can specify a log level to customize the log storage scope.

By default, OBS SDK for Java saves log files of the WARN and higher levels to local directories.

Configuring a storage path for log files

No

Configure a local path to store logs.