//获取文件名 File in = new File("文件地址"); String fileName = in.getName(); String name = fileName.substring(fileName.lastIndexOf(".")+1); 等等