posts - 56, comments - 54, trackbacks - 0, articles - 4
             ::  ::  :: 聯(lián)系 :: 聚合  :: 管理

          使用java復(fù)制移動文件

          Posted on 2005-11-17 16:03 Terry的Blog 閱讀(5262) 評論(2)  編輯  收藏 所屬分類: java語言
              /**
               * Moving a File to Another Directory
               * @param srcFile  eg: c:\windows\abc.txt
               * @param destPath eg: c:\temp
               * @return success
               */
              public static boolean move(String srcFile, String destPath){
                  // File (or directory) to be moved
                  File file = new File(srcFile);
                 
                  // Destination directory
                  File dir = new File(destPath);
                 
                  // Move file to new directory
                  boolean success = file.renameTo(new File(dir, file.getName()));
                 
                  return success;
              }

          評論

          # re: 使用java復(fù)制移動文件[未登錄]  回復(fù)  更多評論   

          2008-01-04 11:49 by selina
          thanks ,i'm success!

          # re: 使用java復(fù)制移動文件  回復(fù)  更多評論   

          2008-01-22 14:44 by 怎么羨慕天空的飛鳥
          不錯。性能應(yīng)該比流的形式好點。
          主站蜘蛛池模板: 罗源县| 鹿泉市| 洪洞县| 清镇市| 武汉市| 泸定县| 峨眉山市| 沾益县| 马龙县| 双流县| 灌云县| 客服| 丹棱县| 开化县| 青河县| 舞阳县| 满洲里市| 沙坪坝区| 阿图什市| 罗定市| 岫岩| 海伦市| 民权县| 剑川县| 泽州县| 阿巴嘎旗| 日照市| 龙海市| 贡觉县| 梁河县| 安顺市| 扶绥县| 仁化县| 灵山县| 兴文县| 安福县| 高淳县| 海淀区| 孝昌县| 辽源市| 甘肃省|