Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/320.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何删除添加到文件中的名称?_Java_Encryption - Fatal编程技术网

Java 如何删除添加到文件中的名称?

Java 如何删除添加到文件中的名称?,java,encryption,Java,Encryption,我正在读取一个文件名并对其进行加密,然后使用其他名称进行保存 FileInputStream inFile = new FileInputStream("cv-resume.pdf"); //encrypt FileOutputStream outFile = new FileOutputStream("cv-resume.pdf"+".enc"); 解密后,我想删除“.enc”以恢复原始文件名。你知道怎么做吗?谢谢你的帮助。你试过这个吗 FileOutputStream inFileEncr

我正在读取一个文件名并对其进行加密,然后使用其他名称进行保存

FileInputStream inFile = new FileInputStream("cv-resume.pdf");
//encrypt
FileOutputStream outFile = new FileOutputStream("cv-resume.pdf"+".enc");
解密后,我想删除“.enc”以恢复原始文件名。你知道怎么做吗?谢谢你的帮助。

你试过这个吗

FileOutputStream inFileEncrypt = new FileInputStream("cv-resume.pdf.enc");
//Decrypt
FileOutputStream outFileDecrypt = new FileOutputStream("cv-resume.pdf");

你是说,你想将
cv resume.pdf.enc
重新命名为
cv resume.pdf
?您不能使用
文件
重命名
API吗?