• Post Reply Bookmark Topic Watch Topic
  • New Topic

File deletion

 
kri shan
Ranch Hand
Posts: 1480
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to delete a file from directory based on the specified time period. Like WatchService
 
Stephan van Hulst
Bartender
Posts: 6583
84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on what time period? Like WatchService how?

Please ask more clear, detailed questions.
 
kri shan
Ranch Hand
Posts: 1480
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
time period based on minutes (60 minutes.) Can i WatchService or other API ?
 
Stephan van Hulst
Bartender
Posts: 6583
84
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WatchService allows you to wait for events. Your problem isn't event-based but time-based.

You could use the java.nio.file.Files API in combination with a java.util.concurrent.ScheduledExecutorService to achieve this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!