aQute.libg.glob.Glob.matcher()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中aQute.libg.glob.Glob.matcher()方法的一些代码示例,展示了Glob.matcher()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Glob.matcher()方法的具体详情如下:
包路径:aQute.libg.glob.Glob
类名称:Glob
方法名:matcher

Glob.matcher介绍

暂无

代码示例

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public static boolean in(Glob[] globs, String key) {
  for (Glob g : globs) {
    if (g.matcher(key)
      .matches())
      return true;
  }
  return false;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public static boolean in(Collection<? extends Glob> globs, String key) {
  for (Glob g : globs) {
    if (g.matcher(key)
      .matches())
      return true;
  }
  return false;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
  boolean isIncluded(String segments[], int n) {
    if (n != segments.length - 1)
      return false;
    return glob.matcher(segments[n])
      .matches();
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public static boolean in(Glob[] globs, String key) {
  for (Glob g : globs) {
    if (g.matcher(key)
      .matches())
      return true;
  }
  return false;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository

@Override
  boolean isIncluded(String segments[], int n) {
    if (n != segments.length - 1)
      return false;
    return glob.matcher(segments[n])
      .matches();
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
void match(Collection<File> files, File input) {
  if (input.isFile()) {
    if (glob.matcher(input.getName())
      .matches())
      files.add(input);
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

@Override
void match(Collection<File> files, File input) {
  if (input.isFile()) {
    if (glob.matcher(input.getName())
      .matches())
      files.add(input);
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository

@Override
void match(Collection<File> files, File input) {
  if (input.isFile()) {
    if (glob.matcher(input.getName())
      .matches())
      files.add(input);
  }
}

代码示例来源:origin: org.osgi/osgi.enroute.web.simple.provider

public void select(List< ? > objects) {
  for (Iterator< ? > i = objects.iterator(); i.hasNext();) {
    String s = i.next().toString();
    if (!matcher(s).matches())
      i.remove();
  }
}

代码示例来源:origin: biz.aQute.bnd/bndlib

public void select(List< ? > objects) {
  for (Iterator< ? > i = objects.iterator(); i.hasNext();) {
    String s = i.next().toString();
    if (!matcher(s).matches())
      i.remove();
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public void getFiles(File root, List<File> result, boolean recursive, boolean usePath) {
  if (root == null || !root.isDirectory())
    return;
  for (File sub : root.listFiles()) {
    if (sub.isFile()) {
      String s = usePath ? sub.getAbsolutePath() : sub.getName();
      if (matcher(s).matches())
        result.add(sub);
    } else if (recursive && sub.isDirectory())
      getFiles(sub, result, recursive, usePath);
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

private static void traverse(Collection<File> files, File current, Glob glob) {
  if (current.isFile() && (glob == null || glob.matcher(current.getName())
    .matches())) {
    files.add(current);
  } else if (current.isDirectory()) {
    for (File sub : current.listFiles()) {
      traverse(files, sub, glob);
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
void match(Collection<File> files, File input) {
  if (input.isDirectory()) {
    if (glob.matcher(input.getName())
      .matches()) {
      for (File sub : input.listFiles()) {
        next.match(files, sub);
      }
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
boolean isIncluded(String segments[], int n) {
  if (n >= segments.length - 1)
    return false;
  if (!glob.matcher(segments[n])
    .matches())
    return false;
  return next.isIncluded(segments, n + 1);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository

@Override
boolean isIncluded(String segments[], int n) {
  if (n >= segments.length - 1)
    return false;
  if (!glob.matcher(segments[n])
    .matches())
    return false;
  return next.isIncluded(segments, n + 1);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.resolve

public void getFiles(File root, List<File> result, boolean recursive, boolean usePath) {
  if (root == null || !root.isDirectory())
    return;
  for (File sub : root.listFiles()) {
    if (sub.isFile()) {
      String s = usePath ? sub.getAbsolutePath() : sub.getName();
      if (matcher(s).matches())
        result.add(sub);
    } else if (recursive && sub.isDirectory())
      getFiles(sub, result, recursive, usePath);
  }
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension

private static void traverse(Collection<File> files, File current, Glob glob) {
  if (current.isFile() && (glob == null || glob.matcher(current.getName())
    .matches())) {
    files.add(current);
  } else if (current.isDirectory()) {
    for (File sub : current.listFiles()) {
      traverse(files, sub, glob);
    }
  }
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle

private static void traverse(Collection<File> files, File current, Glob glob) {
  if (current.isFile() && (glob == null || glob.matcher(current.getName())
    .matches())) {
    files.add(current);
  } else if (current.isDirectory()) {
    for (File sub : current.listFiles()) {
      traverse(files, sub, glob);
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

@Override
void match(Collection<File> files, File input) {
  if (input.isDirectory()) {
    if (glob.matcher(input.getName())
      .matches()) {
      for (File sub : input.listFiles()) {
        next.match(files, sub);
      }
    }
  }
}

代码示例来源:origin: biz.aQute/bnd

public InputStream connect(URL url) throws IOException {
  init();
  
  for (Mapping mapping : mappings) {
    Matcher matcher = mapping.urlPattern.matcher(url.toString());
    if (matcher.find())
      return connect(url, mapping.user, mapping.pass);
  }
  
  return url.openStream();
}

相关文章