O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required