Hi All :
I have to send mail along with embedded image. Once the mail has been sent, image in the application server should be deleted immediately. Problem i am facing is, after mail sent the control goes method which contain
File file = new File("../bar.jpeg")
if(file.exists()){
file.delete();
System.out.println("Barcode Image Deleted");
}
Its printing "Barcode Image Deleted". But image in the folder is not getting deleted and it still present in same location. I am using multipart to attach image in mail. Can anyone help me why its not getting deleted?