com.github.keub.maven.plugin.service.IncludeService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of remote-resources-maven-plugin Show documentation
Show all versions of remote-resources-maven-plugin Show documentation
Copy files from a remote location to a path relative to the project in which the plugin is configured.
package com.github.keub.maven.plugin.service;
import java.util.HashSet;
import java.util.Set;
import com.github.keub.maven.plugin.utils.AntPathMatcher;
import com.github.keub.maven.plugin.utils.FileUtils;
public class IncludeService {
/**
* include only file match with pattern into includes set
*
* @param includes
* @param files
*/
public static Set process(Set includes, Set files) {
if (includes == null || files == null) {
return files;
}
Set retval = new HashSet();
AntPathMatcher antPathMatcher = new AntPathMatcher();
for (String pattern : includes) {
for (String path : files) {
boolean match = antPathMatcher.match(pattern,
FileUtils.normalizePath(path));
if (match) {
retval.add(path);
}
}
}
return retval;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy