??? // Copies all files under srcDir to dstDir.
??? // If dstDir does not exist, it will be created.
??? public void copyDirectory(File srcDir, File dstDir) throws IOException {
??????? if (srcDir.isDirectory()) {
??????????? if (!dstDir.exists()) {
??????????????? dstDir.mkdir();
??????????? }
???
??????????? String[] children = srcDir.list();
??????????? for (int i=0; i<children.length; i++) {
??????????????? copyDirectory(new File(srcDir, children[i]),
???????????????????????????????????? new File(dstDir, children[i]));
??????????? }
??????? } else {
??????????? // This method is implemented in
e1071 Copying a File
??????????? copyFile(srcDir, dstDir);
??????? }
??? }
|----------------------------------------------------------------------------------------|
版權(quán)聲明 版權(quán)所有 @zhyiwww
引用請(qǐng)注明來(lái)源 http://www.tkk7.com/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2006-06-13 11:37
zhyiwww 閱讀(264)
評(píng)論(0) 編輯 收藏 所屬分類(lèi):
code demo -java