Thursday 19 March 2020

Java File.deleteOnExit() method

  1. import java.io.File;  
  2. import java.io.IOException;  
  3. public class DeleteOnExitExample  
  4. {  
  5. public static void main(String[] args)  
  6. {  
  7. File temp;  
  8. try  
  9. {  
  10. temp = File.createTempFile("abc"".temp");     //creating a .temp file  
  11. System.out.println("Temp file created at location: " + temp.getAbsolutePath());      
  12. temp.deleteOnExit();                     //delete file on runtime exit  
  13. System.out.println("Temp file exists : " + temp.exists());  
  14. }   
  15. catch (IOException e)  
  16. {  
  17. e.printStackTrace();  
  18. }  
  19. }  
  20. }  

No comments:

Post a Comment

OADBTransactionImpl in Oracle Application Framework (OAF)

OADBTransactionImpl is a class in Oracle Application Framework (OAF), which is a framework for building Oracle E-Business Suite applications...