用Java来批量修改文件夹下的文件名

我想这是一个非常实用的程序,虽然只有短短几行代码而已:

/*
 * Author :MaJinZe,马金泽,http://ifounder.spaces.live.com
 */
import java.io.*;
public class FileRename 
{
	public static void main(String[] args)
	{
		java.io.File filed=new java.io.File("C:\\Inetpub\\wwwroot\\image");
		File[] FS=filed.listFiles();
		for(int index=0;index<FS.length;index++)
		{
			FS[index].renameTo(new File("C:\\Inetpub\\wwwroot\\image\\"+index+".jpg"));
		}
	}

}
原文地址:https://www.cnblogs.com/MicroGoogle/p/Change_FileName_Using_Java.html