Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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
 
Bartender
Posts: 9496
184
  • 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
Bartender
Posts: 9496
184
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!