0

How can we subscribe to file present as resource in Scala project so that any live changed to the file can be detected in the the service? Example there is a Scala code which is calculating sum of numbers from the text file , how to subscribe to that file in the code so that program can act upon immediately for any addition of new numbers in the file.

user1079341
  • 111
  • 7
  • possible duplicate of http://stackoverflow.com/questions/27360977/how-to-read-files-from-resources-folder-in-scala ? – mkazma Mar 17 '16 at 15:53

1 Answers1

0

In Scala you can use Java classes and APIs. You can use the Java Watch Service API in java.nio.file. You can about it here.

Simon
  • 6,293
  • 2
  • 28
  • 34