com.jessecoyle.WildcardHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcredstash Show documentation
Show all versions of jcredstash Show documentation
A pure Java implementation of the CredStash utility originally in Python
The newest version!
package com.jessecoyle;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Stream;
class WildcardHelper {
static Stream credentialNamesMatchingWildcard(List credentialVersions, String credential) {
Pattern pattern = Pattern.compile('^' + credential.replace("*", ".*") + '$');
return credentialVersions.stream()
.map(CredentialVersion::getName)
.distinct()
.filter(name -> pattern.matcher(name).matches());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy