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

jodd.io.filter.WildcardFileFilter Maven / Gradle / Ivy

Go to download

Jodd Core tools and utilities, including type converters, JDateTime, cache etc.

There is a newer version: 5.3.0
Show newest version
// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.io.filter;

import java.io.File;

import jodd.util.Wildcard;

/**
 * FileFilter that matches file names against
 * {@link Wildcard#matchPath(String, String) wildcard} pattern (*, ? and **).
 */
public class WildcardFileFilter extends FileFilterBase {

	private final String pattern;

	/**
	 * Wildcard file filter.
	 */
	public WildcardFileFilter(String pattern) {
		this.pattern = pattern;
	}

	@Override
	public boolean accept(File dir, String name) {
		return Wildcard.matchPath(name, pattern);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy