docs: public boolean update(File directory, String fileName, String fileExtension, int maxFiles) {
          this.maxFiles = maxFiles;
  
          boolean updateLocation = !directory.equals(this.directory) || !fileName.equals(this.fileName) || !fileExtension.equals(this.fileExtension);
          if (updateLocation) {
              this.directory = directory;
              this.fileName = fileName;
              this.fileExtension = fileExtension;
              filePattern = LoggingFileUtils.compileLogFileRegex(fileName, fileExtension);
  
              // The location was updated, so remove our list of cached files.
              files = null;
          }
  
          if (maxFiles <= 0) {
              files = null;
          } else {
              if (files == null) {
                  files = new ArrayList<String>();
  
                  // Sort and add all existing files.
                  String[] existing = LoggingFileUtils.safelyFindFiles(directory, filePattern);
                  if (existing != null) {
                      Arrays.sort(existing, NaturalComparator.instance);
                      files.addAll(Arrays.asList(existing));
                  }
              }
  
              // Delete excess old files if necessary.
              int maxTrackedFiles = getMaxDateFiles();
              while (files.size() > maxTrackedFiles) {
                  removeFile(0);
              }
  
              // If the location was updated, initialize the counter from the
              // remaining files (if any).
              if (updateLocation) {
                  if (files.isEmpty()) {
                      lastDateString = null;
                  } else {
                      Matcher matcher = filePattern.matcher(files.get(files.size() - 1));
                      if (!matcher.matches())
                          throw new IllegalStateException();
  
                      lastDateString = matcher.group(1);
                      lastCounter = Integer.parseInt(matcher.group(2));
                  }
              }
          }
  
          return updateLocation;
      }