com.commercehub.gradle.plugin.avro.FileExtensionSpec Maven / Gradle / Ivy
package com.commercehub.gradle.plugin.avro;
import org.gradle.api.specs.Spec;
import java.io.File;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
class FileExtensionSpec implements Spec {
private final Set extensions;
FileExtensionSpec(String... extensions) {
this.extensions = new HashSet(Arrays.asList(extensions));
}
FileExtensionSpec(Collection extensions) {
this.extensions = new HashSet(extensions);
}
@Override
public boolean isSatisfiedBy(File file) {
return extensions.contains(FilenameUtils.getExtension(file.getName()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy