Bug 738890 - Fix testJarReader. r=wesj

This commit is contained in:
Nick Alexander
2013-06-21 14:00:39 -07:00
parent 2b564f02f4
commit 520f59bbb9
3 changed files with 48 additions and 17 deletions

View File

@@ -98,6 +98,20 @@ public final class GeckoJarReader {
return new NativeZip(fileUrl.getPath());
}
// Public for testing only.
public static InputStream getStream(String url) {
Stack<String> jarUrls = parseUrl(url);
try {
NativeZip zip = getZipFile(jarUrls.pop());
return getStream(zip, jarUrls, url);
} catch (Exception ex) {
// Some JNI code throws IllegalArgumentException on a bad file name;
// swallow the error and return null. We could also see legitimate
// IOExceptions here.
return null;
}
}
private static InputStream getStream(NativeZip zip, Stack<String> jarUrls, String origUrl) {
InputStream inputStream = null;