• Post Reply Bookmark Topic Watch Topic
  • New Topic

File deletion  RSS feed

 
kri shan
Ranch Hand
Posts: 1487
  • 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
Saloon Keeper
Posts: 6999
110
  • 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: 1487
  • 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
Saloon Keeper
Posts: 6999
110
  • 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!