urlString = urlString.substring(0, urlString.length() - 2);
url = new URL(urlString);
}
if (!urlString.endsWith("/")) {
return new JarFileReader(url.openStream(), filter);
} else {
if (!url.getProtocol().equals("file")) {
throw new IOException("Unable to understand protocol: " + url.getProtocol());
}
File f = new File(url.getPath());
if (f.isDirectory()) {
return new ClassFileReader(f, filter);
} else {
return new JarFileReader(url.openStream(), filter);
}
}
}