Here you can find the source of renameFile(File file, String sign, String suffix)
public static void renameFile(File file, String sign, String suffix)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static void renameFile(File file, String sign, String suffix) { String name = file.getAbsolutePath(); int index = name.lastIndexOf(suffix); String newName = name.substring(0, index) + "_" + sign + name.substring(index, name.length()); file.renameTo(new File(newName)); }//ww w . j a v a 2 s . c o m }