Posted on 2006-01-11 14:40
yoyozy 閱讀(155)
評(píng)論(0) 編輯 收藏
目錄文件的操作
目錄文件的操作也是除了數(shù)據(jù)庫(kù)操作以外,經(jīng)常需要操作的一個(gè)數(shù)據(jù)對(duì)象.
移動(dòng)文件,相當(dāng)于linux 中mv命令,但與平臺(tái)無(wú)關(guān):
/**
* This class moves an input file to output file
*
* @param
String input file to move from
* @param String output
file
*
*/
public static void move (String input, String
output){
File inputFile = new File(input);
File outputFile = new
File(output);
inputFile.renameTo(outputFile);
}
<

文章來(lái)源:
http://blog.donews.com/yoyozy/archive/2005/11/02/611867.aspx