当前位置: 首页 > news >正文

福建微网站建设价格wordpress设置邮件注册

福建微网站建设价格,wordpress设置邮件注册,网站备案信息被注销,潍坊网站建设网超目录 1 需求2 实现 1 需求 我现在有一个300MB 的文件,想要根据这个文件,创建100万个大小一样的,名称不一样,如何实现,如何比较快点实现 2 实现 1 先准备好这个文件 2 准备好目录 3 写代码 private static void crea…

目录

  • 1 需求
  • 2 实现

1 需求

我现在有一个300MB 的文件,想要根据这个文件,创建100万个大小一样的,名称不一样,如何实现,如何比较快点实现

2 实现

1 先准备好这个文件

在这里插入图片描述

2 准备好目录

在这里插入图片描述
3 写代码

private static void createFile(String sourceFilePath,String destinationFolderPath, int fileNumber) {File file1 = new File(sourceFilePath);Path sourcePath = Paths.get(sourceFilePath);String destinationFileName = "copy_" + UUID.randomUUID().toString() + "_" + file1.getName();Path destinationPath = Paths.get(destinationFolderPath, destinationFileName);//try {// 复制源文件到目标文件Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);} catch (IOException e) {e.printStackTrace();}}public static void main(String[] args) {String sourceFilePath = "D:\\100w\\source\\1111111111111.HDF"; // 替换为实际的源文件路径String destinationFolderPath = "D:\\100w\\dest"; // 替换为实际的目标文件夹路径int numFiles = 1000000; // 需要创建的文件数量int numThreads = Runtime.getRuntime().availableProcessors(); // 使用可用的处理器核心数作为线程数ExecutorService executorService = Executors.newFixedThreadPool(numThreads);try {// 创建目标文件夹(如果不存在)Files.createDirectories(Paths.get(destinationFolderPath));// 循环提交文件创建任务给线程池for (int i = 100; i < numFiles; i++) {int fileNumber = i;executorService.submit(() -> createFile(sourceFilePath,destinationFolderPath, fileNumber));}executorService.shutdown();} catch (IOException e) {e.printStackTrace();}//        try {//            // 获取源文件的路径对象//            Path sourcePath = Paths.get(sourceFilePath);////            // 创建目标文件夹(如果不存在)//            Files.createDirectories(Paths.get(destinationFolderPath));////            // 循环复制文件并创建副本文件//            for (int i = 0; i < numFiles; i++) {//                // 构造目标文件的路径对象//                String destinationFileName = "copy_" + i + "_" + sourcePath.getFileName();//                Path destinationPath = Paths.get(destinationFolderPath, destinationFileName);////                // 复制源文件到目标文件//                Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);//            }////            System.out.println("文件复制完成!");//        } catch (IOException e) {//            e.printStackTrace();//        }}
http://www.yayakq.cn/news/933161/

相关文章:

  • 营销型网站建设设计服务wordpress图片广告代码
  • 陕西网站建设哪家强沈阳网站建设服务器
  • 网站信用建设应该用什么技术网站模板 单页
  • 临夏金属装饰网站建设0791网站建设
  • 郑州网站推广效果怎么把本地wordpress上传
  • 机械做网站百度电话查询
  • 网站静态网架公司是做什么的
  • 珠海网站外包台州营销型网站建设
  • 全球著名科技网站wordpress怎么添加论坛
  • 网站做零售网站推广的常用途径有哪些
  • 电子商务网站建设的核心多选手机网站的开发
  • 商城网站建设方案 2017扬州市市政建设处网站
  • 个人网站开发计划书某景区网站建设策划书
  • 口碑好的网站建设公司哪家好市场推广计划怎么写
  • 站内优化做视频网站的公司有哪些
  • 广州网站建设工作室招聘满洲里网站建设
  • 深圳宝安高端网站建设报价网站开发摊销期多少年
  • wordpress 做api接口百度seo外链推广教程
  • 英语写作网站建网页网站
  • 住房和城乡建设部网站造价王者荣耀网页设计报告
  • 架设网站多少钱一个服务器可以做两个网站吗
  • 外贸商城网站建设网站降权如何恢复
  • 优化网站页面网页广告调词平台多少钱
  • 三更app下载网站阳朔网站建设公司
  • 网站建设套餐有哪些如何设计好的网页
  • 网站建设所需硬件南京制作网站速成班
  • 网站在哪里备案ps淘宝网页设计教程
  • 网站开发人员 生活怎么在公众号做影视网站
  • 营销型网站建设的优势有哪些网站开发建设需要多少钱
  • 网站参考模板自学编程