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

org.whitesource.utils.files.SingleFileScanner Maven / Gradle / Ivy

/**
 * The project is licensed under the WhiteSource Software End User License Agreement .
 * Copyright (C) 2015 WhiteSource Ltd.
 * Licensed under the WhiteSource Software End User License Agreement;
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * https://s3.amazonaws.com/unified-agent/LICENSE.txt
 */
package org.whitesource.utils.files;

import org.apache.tools.ant.DirectoryScanner;

import java.io.File;

/**
 * A {@link DirectoryScanner} for a single file.
 *
 * @author tom.shapira
 */
public class SingleFileScanner extends DirectoryScanner {

    /**
     * Exposes the {@link DirectoryScanner#isIncluded(String)} method to check if a single file should be included
     * in the scan.
     *
     * @param file for scanning
     * @return weather the file should be included or not
     */
    public boolean isIncluded(File file) {
        return isIncluded(file.getAbsolutePath());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy