use of aQute.libg.glob.Glob in project bnd by bndtools.
the class HttpBasicAuthURLConnector method init.
protected void init() {
if (inited.compareAndSet(false, true)) {
mappings.clear();
StringTokenizer tokenizer = new StringTokenizer(configFileList, ",");
while (tokenizer.hasMoreTokens()) {
String configFileName = tokenizer.nextToken().trim();
File file = new File(configFileName);
if (file.exists()) {
Properties props = new UTF8Properties();
try (InputStream stream = IO.stream(file)) {
props.load(stream);
for (Object key : props.keySet()) {
String name = (String) key;
if (name.startsWith(PREFIX_PATTERN)) {
String id = name.substring(PREFIX_PATTERN.length());
Glob glob = new Glob(props.getProperty(name));
String uid = props.getProperty(PREFIX_USER + id);
String pwd = props.getProperty(PREFIX_PASSWORD + id);
mappings.add(new Mapping(id, glob, uid, pwd));
}
}
} catch (IOException e) {
if (reporter != null)
reporter.error("Failed to load %s", configFileName);
}
}
}
}
}
use of aQute.libg.glob.Glob in project bnd by bndtools.
the class AbstractIndexedRepo method list.
public List<String> list(String pattern) throws Exception {
init();
Glob glob = pattern != null ? new Glob(pattern) : null;
List<String> result = new LinkedList<String>();
for (String bsn : identityMap.getIdentities()) {
if (glob == null || glob.matcher(bsn).matches())
result.add(bsn);
}
return result;
}
Aggregations