    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      https://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017
    018package org.apache.commons.io.file;
    019
    020import java.nio.file.FileVisitResult;
    021import java.nio.file.Path;
    022import java.nio.file.attribute.BasicFileAttributes;
    023
    024/**
    025 * A filter for {@link Path}s.
    026 *
    027 * @since 2.9.0
    028 */
    029@FunctionalInterface
    030public interface PathFilter {
    031
    032    /**
    033     * Tests whether or not to include the specified Path in a result.
    034     *
    035     * @param path The Path to test.
    036     * @param attributes the path's basic attributes (may be null).
    037     * @return a FileVisitResult
    038     */
    039    FileVisitResult accept(Path path, BasicFileAttributes attributes);
    040}