All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.swoval.files.FileTreeDataView Maven / Gradle / Ivy

There is a newer version: 2.1.12
Show newest version
package com.swoval.files;

import com.swoval.files.FileTreeDataViews.Entry;
import com.swoval.functional.Filter;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;

/**
 * A repository for which each {@link java.nio.file.Path} has an associated data value.
 *
 * @param  the data value for each path
 */
public interface FileTreeDataView extends FileTreeView, AutoCloseable {
  /**
   * List all of the files for the {@code path that are accepted by the filter}.
   *
   * @param path the path to list. If this is a file, returns a list containing the Entry for the
   *     file or an empty list if the file is not monitored by the path.
   * @param maxDepth the maximum depth of subdirectories to return
   * @param filter include only paths accepted by this
   * @return a List of Entry instances accepted by the filter. The list will be empty if the path is
   *     not a subdirectory of this CachedDirectory or if it is a subdirectory, but the
   *     CachedDirectory was created without the recursive flag.
   * @throws IOException if the path cannot be listed.
   */
  List> listEntries(
      final Path path, final int maxDepth, final Filter> filter)
      throws IOException;

  /**
   * List all of the files for the {@code path}, returning only those files that are accepted by the
   * provided filter.
   *
   * @param path the root path to list
   * @param maxDepth the maximum depth of subdirectories to query
   * @param filter include only paths accepted by the filter
   * @return a List of {@link java.nio.file.Path} instances accepted by the filter.
   * @throws IOException if the path cannot be listed.
   */
  List list(final Path path, final int maxDepth, final Filter filter)
      throws IOException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy