• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to delete th file after some specified time.?

 
bond bond
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Can anyone tell me that how to delete the file after some specified time.?
 
harilal ithikkat
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1 to delete a file
use method(below) of java.io.File
public boolean delete();

2 to make a delay you can use Thread.sleep()
or wait() method
 
harilal ithikkat
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bond bond
dude welcome to Javaranch ...
check this naming policy too
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a ScheduledExecutorService (Java 5.0 and up) comes to mind.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!