Class OpenBatch.ParallelBuilder
java.lang.Object
cloud.opencode.base.io.batch.OpenBatch.ParallelBuilder
- Enclosing class:
OpenBatch
Parallel Batch Operation Builder
并行批量操作构建器
- Since:
- JDK 25, opencode-base-io V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopyAll(Collection<Path> sources, Path targetDir, CopyOption... options) Copy all files in parallel 并行复制所有文件deleteAll(Collection<Path> paths) Delete all files in parallel 并行删除所有文件execute(String operation, Collection<Path> paths, OpenBatch.PathAction action) Execute custom operation in parallel 并行执行自定义操作moveAll(Collection<Path> sources, Path targetDir, CopyOption... options) Move all files in parallel 并行移动所有文件onProgress(OpenBatch.ProgressCallback callback) Set progress callback 设置进度回调parallelism(int parallelism) Set parallelism level 设置并行度stopOnError(boolean stop) Stop on first error 遇到第一个错误时停止
-
Constructor Details
-
ParallelBuilder
public ParallelBuilder()
-
-
Method Details
-
parallelism
Set parallelism level 设置并行度- Parameters:
parallelism- number of parallel threads | 并行线程数- Returns:
- this builder | 构建器
-
onProgress
Set progress callback 设置进度回调- Parameters:
callback- callback function | 回调函数- Returns:
- this builder | 构建器
-
stopOnError
Stop on first error 遇到第一个错误时停止- Parameters:
stop- whether to stop | 是否停止- Returns:
- this builder | 构建器
-
copyAll
Copy all files in parallel 并行复制所有文件- Parameters:
sources- source files | 源文件targetDir- target directory | 目标目录options- copy options | 复制选项- Returns:
- batch result | 批量结果
-
moveAll
Move all files in parallel 并行移动所有文件- Parameters:
sources- source files | 源文件targetDir- target directory | 目标目录options- move options | 移动选项- Returns:
- batch result | 批量结果
-
deleteAll
Delete all files in parallel 并行删除所有文件- Parameters:
paths- files to delete | 要删除的文件- Returns:
- batch result | 批量结果
-
execute
Execute custom operation in parallel 并行执行自定义操作- Parameters:
operation- operation name | 操作名称paths- paths to process | 要处理的路径action- action to perform | 要执行的操作- Returns:
- batch result | 批量结果
-