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

          使用java復制移動文件

          Posted on 2005-11-17 16:03 Terry的Blog 閱讀(5264) 評論(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 怎么羨慕天空的飛鳥
          不錯。性能應該比流的形式好點。
          主站蜘蛛池模板: 博兴县| 盐边县| 手机| 静宁县| 获嘉县| 双桥区| 白朗县| 九龙坡区| 玛曲县| 宾阳县| 安陆市| 同江市| 鄂托克旗| 正蓝旗| 收藏| 巴马| 盐津县| 萝北县| 疏勒县| 南安市| 赞皇县| 荔浦县| 南皮县| 黄浦区| 广昌县| 余庆县| 江华| 怀安县| 临澧县| 陇川县| 富川| 德保县| 柳江县| 横山县| 盐津县| 剑川县| 西畴县| 东源县| 泸西县| 广丰县| 乌拉特前旗|