tencent cloud

Smart Media Hosting

Product Introduction
Product Overview
Feature Description
Product Strengths
Use Cases
Basic Concept
Purchase Guide
Quick Start
Create Media Library
Initiate request
Service Level API Document
History
Introduction
API Category
Making API Requests
PaaS Service APIs
Official Cloud Disk APIs
Data Types
Error Codes
Business Level API Document
Introduction
Access Token Operation API
Tenant Space Operation API
File Operation API
Directory or Album Operation API
Recycle Bin Operation API
Quota Operation API
Query Task Operation API
Search Operation API
Historical Version Operations API
Directory and File Batch Operation API
Collection Operation API
Error Codes
SDK Documentation
Android SDK
iOS SDK
HarmonyOS SDK
FAQs
Enterprise Network Disk
Product Introduction
Purchase Guide
Quick Start
FAQs
Service Level Agreement
Glossary

Batch Move

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-01-07 11:03:08

Introduction

This document provides an API overview and SDK example code for batch moving directories or files.
API
Operation Description
Batch Move Directories or Files

Batch Moving Directories or Files

Feature Overview

Used for batch moving directories or files.
When replicating projects asynchronously in large numbers, it returns HTTP 202 Accepted. When replicating projects synchronously in small numbers, it returns HTTP 200 OK (execution successful) or HTTP 207 Multi-Status (part or all execution failed).

Example Code

Start batch move
try {
//Files or folders to be batch moved
val items: List<BatchMoveItem> = listOf(
BatchMoveItem(
//Source directory, album, or file path to be moved
"fromPath",
//Target directory, album, or file path
"toPath",
//Handling method when filename conflict
ConflictStrategy.RENAME,
//Whether to move folder permissions
true
),
BatchMoveItem("fromPath", "toPath", ConflictStrategy.RENAME, false)
)
//Return batch operation result
//If it is synchronously returned: just obtain the result content directly from batchResponse.result
//If it is asynchronously returned: need to call the Query Task API to obtain the result content (generally poll the query task until the task result is queried)
val batchResponse: BatchResponse = smh.batchMove(
items = items
)
} catch (e: Exception) {
e.printStackTrace()
}
Query job For detailed usage, refer to asynchronous processing.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan