log.trace(_loc.get("scanning-jar", file));
try {
ZipFile zFile = AccessController
.doPrivileged(J2DoPrivHelper
.newZipFileAction(file));
scan(new ZipFileMetaDataIterator(zFile,
newMetaDataFilter()), cparser, names, true, file);
} catch (PrivilegedActionException pae) {
throw (IOException) pae.getException();
}
} else {
if (log.isTraceEnabled())
log.trace(_loc.get("scanning-file", file));
clss = cparser.parseTypeNames(new FileMetaDataIterator
(file));
List<String> newNames = Arrays.asList(clss);
if (log.isTraceEnabled())
log.trace(_loc.get("scan-found-names", newNames, file));
names.addAll(newNames);
File f = AccessController
.doPrivileged(J2DoPrivHelper
.getAbsoluteFileAction(file));
try {
mapPersistentTypeNames(AccessController
.doPrivileged(J2DoPrivHelper.toURLAction(f)), clss);
} catch (PrivilegedActionException pae) {
throw (FileNotFoundException) pae.getException();
}
}
}
}
URL url;
if (urls != null) {
for (Iterator itr = urls.iterator(); itr.hasNext();) {
url = (URL) itr.next();
if ("file".equals(url.getProtocol())) {
File file = AccessController
.doPrivileged(J2DoPrivHelper
.getAbsoluteFileAction(new File(url.getFile())));
if (files != null && files.contains(file)) {
continue;
} else if ((AccessController
.doPrivileged(J2DoPrivHelper.isDirectoryAction(file)))
.booleanValue()) {
if (log.isTraceEnabled())
log.trace(_loc.get("scanning-directory", file));
scan(
new FileMetaDataIterator(file, newMetaDataFilter()),
cparser, names, true, file);
continue;
}
}
if ("vfs".equals(url.getProtocol())) {
if (log.isTraceEnabled()) {
log.trace(_loc.get("scanning-vfs-url", url));
}
final URLConnection conn = url.openConnection();
final Object vfsContent = conn.getContent();
final URL finalUrl = url;
File file = AccessController.doPrivileged(new PrivilegedAction<File>() {
@SuppressWarnings({ "rawtypes", "unchecked" })
public File run() {
try {
Class virtualFileClass = Class.forName("org.jboss.vfs.VirtualFile");
Method getPhysicalFile = virtualFileClass.getDeclaredMethod("getPhysicalFile");
return (File) getPhysicalFile.invoke(vfsContent);
} catch (Exception e) {
log.error(_loc.get("while-scanning-vfs-url", finalUrl), e);
}
return null;
}
});
if (file != null)
scan(new FileMetaDataIterator(file, newMetaDataFilter()), cparser, names, true, file);
continue;
}
if ("jar".equals(url.getProtocol())) {
if (url.getPath().endsWith("!/")) {
if (log.isTraceEnabled())
log.trace(_loc.get("scanning-jar-url", url));
scan(new ZipFileMetaDataIterator(url,
newMetaDataFilter()), cparser, names, true, url);
} else {
if (log.isTraceEnabled())
log.trace(_loc.get("scanning-jar-url", url));
scan(new JarFileURLMetaDataIterator(url,