本文整理了Java中org.jboss.weld.environment.se.Weld.handleDir()
方法的一些代码示例,展示了Weld.handleDir()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Weld.handleDir()
方法的具体详情如下:
包路径:org.jboss.weld.environment.se.Weld
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!