How to do it...

Follow these steps to implement the example:

  1. Create a class named FileSearch and specify that it implements the Runnable interface. This class implements the operation of searching for files with a determined extension modified in the last 24 hours in a folder and its subfolders:
        public class FileSearch implements Runnable {
  1. Declare a private String attribute to store the folder in which the search operation will begin:
        private final String initPath;
  1. Declare another private String attribute to store the extension of the files we are going to look for:
        private final String fileExtension
  1. Declare a private List attribute to store the full path of the files we will find with the desired characteristics:
 private ...

Get Java 9 Concurrency Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.