Kamal kannan Kamal kannan - 1 year ago 119
Groovy Question

How to delete My Local File

This My file Location /opt/dataFileUpload/temp/purchaseOrder/PO-8.pdf, I want to delete PO-8.pdf file.[Note: Only i want to delete The File Not the Folder Path]

Thanks in Advance,

Answer Source

        File file = new File("/opt/dataFileUpload/temp/purchaseOrder/PO-8.pdf");

            System.out.println(file.getName() + " is deleted!");
            System.out.println("Delete operation is failed.");

       }catch(Exception e){


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download