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

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

          Posted on 2005-11-17 16:03 Terry的Blog 閱讀(5264) 評(píng)論(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;
              }

          評(píng)論

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

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

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

          2008-01-22 14:44 by 怎么羨慕天空的飛鳥
          不錯(cuò)。性能應(yīng)該比流的形式好點(diǎn)。
          主站蜘蛛池模板: 石渠县| 濮阳县| 达州市| 武安市| 工布江达县| 仁化县| 亚东县| 子长县| 彰化市| 英超| 临夏市| 鸡泽县| 成安县| 兴安县| 镇江市| 温宿县| 三穗县| 岳西县| 长海县| 雅江县| 大宁县| 长顺县| 平定县| 台前县| 琼海市| 措勤县| 东乡族自治县| 布尔津县| 剑阁县| 江安县| 天柱县| 陕西省| 沙坪坝区| 昭通市| 海晏县| 绿春县| 双流县| 陆河县| 木兰县| 元氏县| 苗栗市|