Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File deletion  RSS feed

 
Ranch Hand
Posts: 1490
  • 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
 
Saloon Keeper
Posts: 8734
162
  • 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: 1490
  • 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: 8734
162
  • 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!