* @exception IOException is thrown if any error prevents the download
* of the JAR
*/
protected int downloadJAR(String filename)
throws IOException {
HttpUrl parsedUrl;
String url;
String[] acceptableTypes = {JAR_MT_1, JAR_MT_2};
String[] extraFieldKeys = new String[3];
String[] extraFieldValues = new String[3];
int jarSize;
String locale;
String prof;
int space;
RandomAccessStream jarOutputStream = null;
OutputStream outputStream = null;
parsedUrl = new HttpUrl(info.jarUrl);
if (parsedUrl.authority == null && info.jadUrl != null) {
// relative URL, add the JAD URL as the base
try {
parsedUrl.addBaseUrl(info.jadUrl);
} catch (IOException e) {
postInstallMsgBackToProvider(
OtaNotifier.INVALID_JAD_MSG);
throw new InvalidJadException(
InvalidJadException.INVALID_JAR_URL);
}
url = parsedUrl.toString();
// The JAR URL saved to storage MUST be absolute
info.jarUrl = url;
} else {
url = info.jarUrl;