src/share/classes/com/sun/tools/extcheck/ExtCheck.java
Print this page
@@ -34,10 +34,11 @@
import java.util.jar.JarFile;
import java.util.jar.JarEntry;
import java.util.jar.Manifest;
import java.util.jar.Attributes;
import java.util.jar.Attributes.Name;
+import java.util.zip.ZipException;
import java.net.URLConnection;
import java.security.Permission;
import java.util.jar.*;
import java.net.JarURLConnection;
import sun.net.www.ParseUtil;
@@ -193,11 +194,17 @@
*/
private boolean checkURLRecursively(int indent, URL url)
throws IOException
{
verboseMessage("Comparing with " + url);
- JarLoader jarloader = new JarLoader(url);
+ JarLoader jarloader = null;
+ try {
+ jarloader = new JarLoader(url);
+ } catch (ZipException ze) {
+ verboseMessage("... skipping non-jar file " + url);
+ return true;
+ }
JarFile j = jarloader.getJarFile();
Manifest man = j.getManifest();
if (man != null) {
Attributes attr = man.getMainAttributes();
if (attr != null){
@@ -325,24 +332,21 @@
private URL csu;
/*
* Creates a new Loader for the specified URL.
*/
- JarLoader(URL url) {
+ JarLoader(URL url) throws IOException {
String urlName = url + "!/";
URL tmpBaseURL = null;
try {
tmpBaseURL = new URL("jar","",urlName);
jar = findJarFile(url);
csu = url;
} catch (MalformedURLException e) {
ExtCheck.error("Malformed url "+urlName);
- } catch (IOException e) {
- ExtCheck.error("IO Exception occurred");
}
base = tmpBaseURL;
-
}
/*
* Returns the base URL for this Loader.
*/
@@ -403,8 +407,6 @@
i++;
}
return urls;
}
}
-
-
}