This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File deletion  RSS feed

 
kri shan
Ranch Hand
Posts: 1489
  • 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: 7808
142
  • 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: 1489
  • 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: 7808
142
  • Likes 3
  • 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!