posts - 56, comments - 54, trackbacks - 0, articles - 4
             ::  ::  :: 聯系 :: 聚合  :: 管理

          使用java復制移動文件

          Posted on 2005-11-17 16:03 Terry的Blog 閱讀(5267) 評論(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復制移動文件[未登錄]  回復  更多評論   

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

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

          2008-01-22 14:44 by 怎么羨慕天空的飛鳥
          不錯。性能應該比流的形式好點。
          主站蜘蛛池模板: 衡南县| 汕头市| 龙岩市| 若羌县| 宕昌县| 涡阳县| 开远市| 巴彦淖尔市| 永兴县| 永平县| 泾阳县| 山西省| 临江市| 滁州市| 巴彦县| 清苑县| 巴林右旗| 海宁市| 新和县| 寿阳县| 左权县| 工布江达县| 瑞昌市| 库伦旗| 台东县| 六枝特区| 平顶山市| 寿宁县| 玛曲县| 静安区| 钟山县| 会宁县| 丘北县| 新民市| 当阳市| 临沭县| 惠水县| 大兴区| 寿阳县| 微博| 芜湖市|