logger.info("[moduleResource] exits from 'findFiles'");
logger.info("[moduleResource] going to scan controllers"
+ " from these folders or jar files:" + refers);
}
FileSystemManager fileSystem = new FileSystemManager();
for (ResourceRef refer : refers) {
Resource resource = refer.getResource();
if (!refer.hasModifier("controllers")) {
if (logger.isDebugEnabled()) {
logger.debug("[moduleResource] Ignored because not marked as 'controllers'"
+ " in META-INF/rose.properties or META-INF/MANIFEST.MF: "
+ resource.getURI());
}
continue;
}
File resourceFile = resource.getFile();
String urlString;
if ("jar".equals(refer.getProtocol())) {
urlString = ResourceUtils.URL_PROTOCOL_JAR + ":" + resourceFile.toURI()
+ ResourceUtils.JAR_URL_SEPARATOR;
} else {
urlString = resourceFile.toURI().toString();
}
FileObject rootObject = fileSystem.resolveFile(urlString);
if (rootObject == null || !rootObject.exists()) {
if (logger.isDebugEnabled()) {
logger.debug("[moduleResource] Ignored because not exists: " + urlString);
}
continue;
}
if (logger.isInfoEnabled()) {
logger.info("[moduleResource] start to scan moduleResource in file: " + rootObject);
}
try {
int oldSize = local.moduleResourceList.size();
deepScanImpl(local, rootObject, rootObject);
int newSize = local.moduleResourceList.size();
if (logger.isInfoEnabled()) {
logger.info("[moduleResource] got " + (newSize - oldSize) + " modules in "
+ rootObject);
}
} catch (Exception e) {
logger.error("[moduleResource] error happend when scanning " + rootObject, e);
}
fileSystem.clearCache();
}
afterScanning(local);
logger.info("[moduleResource] found " + local.moduleResourceList.size()