public Path generatePath(final @NotNull Clock clock) throws IOException {
    if (!Files.isDirectory(directory)) {
      //createDirectories() _does_ throw FileAlreadyExistsException if path is a _symlink_ to a directory,
      // not a directory itself (JDK-8130464). Check !isDirectory() above should work around that case: if
      // directory is a symlink to an existing dir -> we just skip createDirectories() altogether.
      Files.createDirectories(directory);
    }

    removeOlderFiles();

    String fileName = fileNameFormat.format(new Object[]{clock.millis()});
    return directory.resolve(fileName);
  }
public Path generatePath(final @NotNull Clock clock)