Revision 43345 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/DefaultPackageInfo.java
DefaultPackageInfo.java | ||
---|---|---|
36 | 36 |
import java.util.ArrayList; |
37 | 37 |
import java.util.Iterator; |
38 | 38 |
import java.util.List; |
39 |
import java.util.logging.Level; |
|
40 |
import javax.net.ssl.SSLHandshakeException; |
|
39 | 41 |
import org.apache.commons.lang3.StringUtils; |
40 | 42 |
|
41 | 43 |
import org.gvsig.installer.lib.api.Dependencies; |
... | ... | |
505 | 507 |
|
506 | 508 |
private static final String KEY = "_File_XurlX_download_error"; |
507 | 509 |
|
508 |
public FileDownloadException(URL url, IOException e) {
|
|
510 |
public FileDownloadException(URL url, Exception e) { |
|
509 | 511 |
super(message, e, KEY, serialVersionUID); |
510 | 512 |
setValue("url", url.toString()); |
511 | 513 |
} |
... | ... | |
574 | 576 |
} |
575 | 577 |
|
576 | 578 |
private File downloadFromPackageInfoURL(Download download) throws FileDownloadException { |
579 |
URL url = this.getDownloadURL(); |
|
577 | 580 |
try { |
578 |
return download.downloadFile(this.getDownloadURL(), null); |
|
579 |
} catch (IOException ex3) { |
|
580 |
throw new FileDownloadException(this.getDownloadURL(), ex3); |
|
581 |
return download.downloadFile(url, null); |
|
582 |
} catch(SSLHandshakeException ex) { |
|
583 |
// Si ha habido un problema con el certificado de https, |
|
584 |
// lo reintentamos con http. |
|
585 |
try { |
|
586 |
url = new URL("http", url.getHost(), url.getPort(), url.getFile()); |
|
587 |
return download.downloadFile(url, null); |
|
588 |
} catch (Exception ex1) { |
|
589 |
throw new FileDownloadException(this.getDownloadURL(), ex1); |
|
590 |
} |
|
591 |
} catch (Exception ex) { |
|
592 |
throw new FileDownloadException(this.getDownloadURL(), ex); |
|
581 | 593 |
} |
582 | 594 |
} |
583 | 595 |
|
Also available in: Unified diff