org.jboss.weld.environment.se.Weld.handleDir()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(87)

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

Weld.handleDir介绍

暂无

代码示例

代码示例来源:origin: org.jboss.weld.se/weld-se

private void handleDir(File packDir, boolean scanRecursively, String packName, Set<String> foundClasses) {
  if (packDir != null && packDir.exists() && packDir.canRead()) {
    for (File file : packDir.listFiles()) {
      if (file.isFile()) {
        if (file.canRead() && Files.isClass(file.getName())) {
          foundClasses.add(Files.filenameToClassname(packName + "." + file.getName()));
        }
      }
      if (file.isDirectory() && scanRecursively) {
        handleDir(file, scanRecursively, packName + "." + file.getName(), foundClasses);
      }
    }
  }
}

代码示例来源:origin: weld/core

private void handleDir(File packDir, boolean scanRecursively, String packName, Set<String> foundClasses) {
  if (packDir != null && packDir.exists() && packDir.canRead()) {
    for (File file : packDir.listFiles()) {
      if (file.isFile()) {
        if (file.canRead() && Files.isClass(file.getName())) {
          foundClasses.add(Files.filenameToClassname(packName + "." + file.getName()));
        }
      }
      if (file.isDirectory() && scanRecursively) {
        handleDir(file, scanRecursively, packName + "." + file.getName(), foundClasses);
      }
    }
  }
}

代码示例来源:origin: weld/core

private void handleDir(File packDir, boolean scanRecursively, String packName, Set<String> foundClasses) {
  if (packDir != null && packDir.exists() && packDir.canRead()) {
    for (File file : packDir.listFiles()) {
      if (file.isFile()) {
        if (file.canRead() && Files.isClass(file.getName())) {
          foundClasses.add(Files.filenameToClassname(packName + "." + file.getName()));
        }
      }
      if (file.isDirectory() && scanRecursively) {
        handleDir(file, scanRecursively, packName + "." + file.getName(), foundClasses);
      }
    }
  }
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

private void handleDir(File packDir, boolean scanRecursively, String packName, Set<String> foundClasses) {
  if (packDir != null && packDir.exists() && packDir.canRead()) {
    for (File file : packDir.listFiles()) {
      if (file.isFile()) {
        if (file.canRead() && Files.isClass(file.getName())) {
          foundClasses.add(Files.filenameToClassname(packName + "." + file.getName()));
        }
      }
      if (file.isDirectory() && scanRecursively) {
        handleDir(file, scanRecursively, packName + "." + file.getName(), foundClasses);
      }
    }
  }
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

protected Set<String> scanPackages() {
  if (packages.isEmpty()) {
    return Collections.emptySet();
  }
  Set<String> foundClasses = new HashSet<String>();
  for (PackInfo packInfo : packages) {
    String packName = packInfo.getPackName();
    URL resourceUrl = packInfo.getResourceUrl(resourceLoader);
    if (resourceUrl != null) {
      WeldSELogger.LOG.scanningPackage(packName, resourceUrl);
      try {
        URI resourceUri = resourceUrl.toURI();
        if (PROCOTOL_FILE.equals(resourceUrl.getProtocol())) {
          File file = new File(resourceUri);
          handleDir(file.isDirectory() ? file : file.getParentFile(), packInfo.isScanRecursively(), packName, foundClasses);
        } else if (PROCOTOL_JAR.equals(resourceUrl.getProtocol())) {
          handleJar(resourceUri, packInfo.isScanRecursively(), packName, foundClasses);
        } else {
          WeldSELogger.LOG.resourceUrlProtocolNotSupported(resourceUrl);
        }
      } catch (URISyntaxException e) {
        CommonLogger.LOG.couldNotReadResource(resourceUrl, e);
      }
    } else {
      WeldSELogger.LOG.packageNotFound(packName);
    }
  }
  return foundClasses;
}

代码示例来源:origin: weld/core

protected Set<String> scanPackages() {
  if (packages.isEmpty()) {
    return Collections.emptySet();
  }
  Set<String> foundClasses = new HashSet<String>();
  for (PackInfo packInfo : packages) {
    String packName = packInfo.getPackName();
    URL resourceUrl = packInfo.getResourceUrl(resourceLoader);
    if (resourceUrl != null) {
      WeldSELogger.LOG.scanningPackage(packName, resourceUrl);
      try {
        URI resourceUri = resourceUrl.toURI();
        if (PROCOTOL_FILE.equals(resourceUrl.getProtocol())) {
          File file = new File(resourceUri);
          handleDir(file.isDirectory() ? file : file.getParentFile(), packInfo.isScanRecursively(), packName, foundClasses);
        } else if (PROCOTOL_JAR.equals(resourceUrl.getProtocol())) {
          handleJar(resourceUri, packInfo.isScanRecursively(), packName, foundClasses);
        } else {
          WeldSELogger.LOG.resourceUrlProtocolNotSupported(resourceUrl);
        }
      } catch (URISyntaxException e) {
        CommonLogger.LOG.couldNotReadResource(resourceUrl, e);
      }
    } else {
      WeldSELogger.LOG.packageNotFound(packName);
    }
  }
  return foundClasses;
}

代码示例来源:origin: weld/core

protected Set<String> scanPackages() {
  if (packages.isEmpty()) {
    return Collections.emptySet();
  }
  Set<String> foundClasses = new HashSet<String>();
  for (PackInfo packInfo : packages) {
    String packName = packInfo.getPackName();
    URL resourceUrl = packInfo.getResourceUrl(resourceLoader);
    if (resourceUrl != null) {
      WeldSELogger.LOG.scanningPackage(packName, resourceUrl);
      try {
        URI resourceUri = resourceUrl.toURI();
        if (PROCOTOL_FILE.equals(resourceUrl.getProtocol())) {
          File file = new File(resourceUri);
          handleDir(file.isDirectory() ? file : file.getParentFile(), packInfo.isScanRecursively(), packName, foundClasses);
        } else if (PROCOTOL_JAR.equals(resourceUrl.getProtocol())) {
          handleJar(resourceUri, packInfo.isScanRecursively(), packName, foundClasses);
        } else {
          WeldSELogger.LOG.resourceUrlProtocolNotSupported(resourceUrl);
        }
      } catch (URISyntaxException e) {
        CommonLogger.LOG.couldNotReadResource(resourceUrl, e);
      }
    } else {
      WeldSELogger.LOG.packageNotFound(packName);
    }
  }
  return foundClasses;
}

代码示例来源:origin: org.jboss.weld.se/weld-se

handleDir(new File(resourceUri), packInfo.isScanRecursively(), packName, foundClasses);
}else {
  handleDir(new File(resourceUri).getParentFile(), packInfo.isScanRecursively(), packName, foundClasses);

相关文章