Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Help Center/ Object Storage Service/ SDK Reference/ Android/ Initialization/ Configuring an Instance of ObsClient

Configuring an Instance of ObsClient

Updated on 2024-06-21 GMT+08:00
NOTICE:

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference.

When you call the ObsConfiguration configuration class to create an instance of ObsClient, you can configure the agent, timeout duration, maximum allowed number of connections, and some other parameters listed in the following table.

Parameter

Description

Method

Recommended Value

connectionTimeout

Timeout period for establishing an HTTP/HTTPS connection, in ms. The default value is 60000.

ObsConfiguration.setConnectionTimeout

[10000, 60000]

socketTimeout

Timeout duration for transmitting data at the Socket layer, in ms. The default value is 60000.

ObsConfiguration.setSocketTimeout

[10000, 60000]

idleConnectionTime

Allowed connection idle time, in ms. If a connection exceeds the specified value, the connection will be closed. The default value is 30000.

ObsConfiguration.setIdleConnectionTime

Default value

maxIdleConnections

Maximum number of allowed idle connections in the connection pool. The default value is 1000.

ObsConfiguration.setMaxIdleConnections

N/A

maxConnections

Maximum number of concurrent HTTP requests. The default value is 1000.

ObsConfiguration.setMaxConnections

Default value

maxErrorRetry

Maximum number of retry attempts (caused by abnormal requests, 500, 503, and other errors). The default value is 3.

NOTE:

This parameter is invalid in object upload and download APIs if an interruption occurs after an upload or download task enters the data flow processing phase. In this case, no retry is performed.

ObsConfiguration.setMaxErrorRetry

[0, 5]

endPoint

Endpoint for accessing OBS, which contains the protocol type, domain name (or IP address), and port number. For example, https://your-endpoint:443.

For security purposes, you are advised to use HTTPS.

ObsConfiguration.setEndPoint

N/A

httpProxy

HTTP proxy configuration. This parameter is left blank by default.

ObsConfiguration.setHttpProxy

N/A

validateCertificate

Whether to verify the server certificate. The default value is false.

ObsConfiguration.setValidateCertificate

N/A

verifyResponseContentType

Whether to verify ContentType of the response header. The default value is true.

ObsConfiguration.setVerifyResponseContentType

Default value

uploadStreamRetryBufferSize

Size of the cache used for uploading a stream object, in bytes. The default size is 512 KB.

ObsConfiguration.setUploadStreamRetryBufferSize

N/A

readBufferSize

Cache size for downloading the object from socket streams, in bytes. Value -1 indicates that cache is not configured. The default value is -1.

ObsConfiguration.setReadBufferSize

N/A

writeBufferSize

Cache size for uploading the object to socket streams, in bytes. Value -1 indicates that cache is not configured. The default value is -1.

ObsConfiguration.setWriteBufferSize

N/A

socketWriteBufferSize

Buffer size for sending a socket, in bytes. This parameter corresponds to java.net.SocketOptions.SO_SNDBUF. The default value is -1, which indicates no limitation.

ObsConfiguration.setSocketWriteBufferSize

Default value

socketReadBufferSize

Buffer size for receiving a socket, in bytes. This parameter corresponds to java.net.SocketOptions.SO_RCVBUF. The default value is -1, which indicates no limitation.

ObsConfiguration.setSocketReadBufferSize

Default value

keyManagerFactory

Factory used for generating javax.net.ssl.KeyManager. This parameter is left blank by default.

ObsConfiguration.setKeyManagerFactory

N/A

trustManagerFactory

Factory used for generating javax.net.ssl.TrustManager. This parameter is left blank by default.

ObsConfiguration.setTrustManagerFactory

N/A

isStrictHostnameVerification

Whether to strictly verify the server-side host name. The default value is false.

ObsConfiguration.setIsStrictHostnameVerification

N/A

keepAlive

Whether to use persistent connections to access OBS. The default value is true.

ObsConfiguration.setKeepAlive

N/A

cname

Whether to use self-defined domain name to access OBS. The default value is false.

ObsConfiguration.setCname

N/A

sslProvider

Provider of SSLContext. The SSLContext provided by JDK is used by default.

ObsConfiguration.setSslProvider

N/A

httpProtocolType

HTTP protocol type used for accessing OBS servers. The default protocol is HTTP 1.1.

ObsConfiguration.setHttpProtocolType

N/A

httpDispatcher

Customized dispatcher

ObsConfiguration.setHttpDispatcher

N/A

NOTE:
  • Parameters whose recommended value is N/A need to be set according to the actual conditions.
  • To improve the upload and download performance of large files in the case that the network bandwidth meets the requirements, you can tune the socketWriteBufferSize, sockeReadBufferSize, readBufferSize, and writeBufferSize parameters.
  • If the network is unstable, you are advised to set larger values for connectionTimeout and socketTimeout.
  • If the value of endPoint does not contain any protocol, HTTPS is used by default.
  • For the sake of high DNS resolution performance and OBS reliability, you can set endPoint only to the domain name of OBS, instead of the IP address.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback