更改文件后缀名

 
     private   void  changeFilePostfix(File file, String postfix) {
           String filePath 
=  file.getAbsolutePath();
           String newFilePath 
=  filePath.substring( 0 , filePath.lastIndexOf( " . " ))  +   " . "   +  postfix;
           file.renameTo(
new  File(newFilePath));
    }

你可能感兴趣的:(File)