docs: @Override
      public synchronized void setOverlayDirectory(File cacheDirForOverlayContent, File f) {
          //check overlay dir exists & is a dir
          if (!FileUtils.fileExists(f) || !Utils.fileIsDirectory(f)) {
              throw new IllegalArgumentException();
          }
          //check cache dir exists & is a dir
          if (!FileUtils.fileExists(cacheDirForOverlayContent) || !Utils.fileIsDirectory(cacheDirForOverlayContent)) {
              throw new IllegalArgumentException();
          }
          //check overlay dir is either empty, or has ".overlay" present in it.
          File overlay = new File(f, ".overlay");
          if (!(FileUtils.listFiles(f).length == 0 || (FileUtils.fileExists(overlay) && FileUtils.fileIsDirectory(overlay)))) {
              throw new IllegalArgumentException();
          }
          //we have to make the content dir for the overlay data.
          if (!FileUtils.fileExists(overlay)) {
              FileUtils.fileMkDirs(overlay);
          }
  
          this.overlayDirectory = overlay;
          this.cacheDirForOverlay = cacheDirForOverlayContent;
          this.fileOverlayContainer = cfHolder.getContainerFactory().getContainer(cacheDirForOverlayContent, overlay);
  
          //could be null if the file impl bundle is awol.. nasty.
          //this should never happen, so throw exception if it does.
          if (this.fileOverlayContainer == null) {
              throw new IllegalStateException();
          }
  
          //initialise the overlay notifier.
          //if we have a parentOverlay, the parent must have been configured with the overlay dir..
          DirectoryBasedOverlayNotifier parentN = this.parentOverlay == null ? null : this.parentOverlay.overlayNotifier;
          this.overlayNotifier = new DirectoryBasedOverlayNotifier(this, fileOverlayContainer, parentN, this.entryInEnclosingContainer);
  
          Set<String> overlaid = this.getOverlaidPaths();
          if (overlaid.size() == 0) {
              this.isPassThroughMode = true;
          } else {
              this.isPassThroughMode = false;
          }
      }