重命名文件
import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Files;/**from nowjava.com**/ import java.nio.file.Path; import java.nio.file.StandardCopyOption; public class Main { public static void main(String[] args) throws Exception { Path movefrom = FileSystems.getDefault().getPath( "C:/folder1/photos/test.jpg"); try { Files.move(movefrom, movefrom.resolveSibling("test_renamed.jpg"),