Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Java SE 综合讨论区
打印话题 寄给朋友 订阅主题 |
作者 | 一道不难的java题(拷贝一个文件夹及其子文件夹) |
zerog
发贴: 15 积分: 0 |
于 2006-08-15 16:11
“编写程序,使其能够拷贝一个文件夹及其子文件夹” 请问高手们,这个正确的编写步骤是怎样的?
why edited on 2006-08-15 16:26
|
作者 | Re:一道不难的java题 [Re:zerog] |
zcjl
涅槃 发贴: 537 积分: 65 |
于 2006-08-15 16:35
1.判断URL是否文件夹,是则跳到步骤3 2.构造目标文件的URL,并通过IO进行文件复制 3.遍历文件夹下的所有文件(夹),以每个文件(夹)的URL作为条件进入到步骤1(递归) |
作者 | Re:一道不难的java题(拷贝一个文件夹及其子文件夹) [Re:zerog] |
zerog
发贴: 15 积分: 0 |
于 2006-08-15 16:47
我是个初学者,您说的很难理解,能否把代码写下来呢!? |
作者 | Re:一道不难的java题(拷贝一个文件夹及其子文件夹) [Re:zerog] |
why
問題兒童 总版主 发贴: 4629 积分: 388 |
于 2006-08-15 16:49
http://javaalmanac.com/egs/java.io/CopyDir.html?l=new |
作者 | Re:一道不难的java题(拷贝一个文件夹及其子文件夹) [Re:zerog] |
why
問題兒童 总版主 发贴: 4629 积分: 388 |
于 2006-08-16 03:50
閣下寫過HelloWorld.java嗎? 不明白閣下為何要把copyDirectory改亂了
or
or use org.apache.commons.io.FileUtils http://jakarta.apache.org/commons/io/api-release/org/apache/commons/io/FileUtils.html
why edited on 2006-08-16 04:26
|
作者 | Re:一道不难的java题(拷贝一个文件夹及其子文件夹) [Re:why] |
zcjl
涅槃 发贴: 537 积分: 65 |
于 2006-08-16 09:21
真是佩服WHY的耐心和细致,不知道楼主对此还有什么问题吗? |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |