Reputation: 98
I have deleted some Files in a Java Program, but I was surprised to see them missing in Recycle Bin? I'm not using any of the IDEs, and is there any way to recover those files?
Upvotes: 0
Views: 558
Reputation: 463
To Answer your question, No. Deleting files removes them from the hard disk completely.
But if you want to move files to Trash in the future, Java 9
has an API for it called moveToTrash.
Below Java 9
you'll have to use JNA or libraries that makes use of it like FileUtils
.
A related question in stackoverflow - Is it Possible with Java to Delete to the Recycle Bin?
Upvotes: 3