private boolean isParentDirectoriesAccepted(File file, int parentsToCheck, BuildRootDescriptor descriptor) {
    File current = file;
    while (parentsToCheck-- > 0) {
      current = FileUtil.getParentFile(current);
      if (!isDirectoryAccepted(current, descriptor)) {
        return false;
      }
    }
    return true;
  }
private boolean isParentDirectoriesAccepted(File file, int parentsToCheck, BuildRootDescriptor descriptor)