I try to delete a PDF File but its not working. when I try to delete a simple text is working test.txt . Is there any other problem?
Source Code:
try{
File f1=new File("D:\\test.pdf");
if(f1.delete()){
System.out.println(f1.getName() + " is deleted!");
}else{
System.out.println("Delete operation is failed.");
}
}catch (Exception e) {
// TODO: handle exception
}