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 怎么羨慕天空的飛鳥
          不錯。性能應該比流的形式好點。
          主站蜘蛛池模板: 贵州省| 闵行区| 布拖县| 农安县| 娱乐| 揭阳市| 绥德县| 仁布县| 呼伦贝尔市| 绿春县| 太湖县| 威海市| 驻马店市| 平远县| 五寨县| 奉贤区| 湟源县| 泸水县| 桃江县| 安义县| 满城县| 岳普湖县| 灵武市| 砀山县| 深水埗区| 将乐县| 比如县| 化德县| 文山县| 翼城县| 兰考县| 金坛市| 九寨沟县| 辽宁省| 德昌县| 黑水县| 星座| 军事| 新疆| 永安市| 高安市|