Here you can find the source of renameFileFromChinese(File file)
public static File renameFileFromChinese(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static File renameFileFromChinese(File file) { String fileName = file.getName(); String extension = getExtension(fileName); String destFileName = fileName.substring(0, fileName.lastIndexOf(File.separator) + 1) + System.currentTimeMillis() + extension; File destFile = new File(destFileName); file.renameTo(destFile);//from w w w . j av a 2s. c o m return destFile; } public static String getExtension(String fileName) { if (fileName != null && fileName.length() > 0) { int i = fileName.lastIndexOf('.'); if (i > -1 && i < fileName.length()) { return fileName.substring(i + 1, fileName.length()); } } return fileName; } }