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

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

          Posted on 2005-11-17 16:03 Terry的Blog 閱讀(5262) 評(píng)論(2)  編輯  收藏 所屬分類: java語(yǔ)言
              /**
               * 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)文件[未登錄](méi)  回復(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 怎么羨慕天空的飛鳥(niǎo)
          不錯(cuò)。性能應(yīng)該比流的形式好點(diǎn)。
          主站蜘蛛池模板: 郎溪县| 泰和县| 灵宝市| 邵武市| 延边| 木兰县| 华坪县| 织金县| 习水县| 景宁| 宁蒗| 车致| 镇安县| 房产| 金川县| 南澳县| 安福县| 麻阳| 平南县| 江华| 芦溪县| 滦南县| 陕西省| 纳雍县| 伽师县| 昌邑市| 宣汉县| 库尔勒市| 丹凤县| 朝阳市| 阳谷县| 瓮安县| 南江县| 康马县| 泸定县| 蒙山县| 余干县| 德州市| 库伦旗| 牙克石市| 方山县|