flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [13/15] git commit: [flex-utilities] [refs/heads/feature/flash-downloader] - - Added an expanation to ssl handshake errors when downloading from sourceforge.
Date Tue, 18 Apr 2017 12:15:19 GMT
- Added an expanation to ssl handshake errors when downloading from sourceforge.


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/581567a9
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/581567a9
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/581567a9

Branch: refs/heads/feature/flash-downloader
Commit: 581567a911b57eb576cac297439919751cfb52c3
Parents: 9b38938
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Fri Feb 10 17:19:49 2017 +0100
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Fri Feb 10 17:19:49 2017 +0100

----------------------------------------------------------------------
 .../retrievers/download/DownloadRetriever.java  | 31 ++++++++++++--------
 1 file changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/581567a9/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
index f80c7f2..a29e2f4 100644
--- a/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
+++ b/flex-maven-tools/flex-sdk-converter/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
@@ -37,6 +37,7 @@ import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
+import javax.net.ssl.SSLHandshakeException;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -85,34 +86,32 @@ public class DownloadRetriever extends BaseRetriever {
                 confirmLicenseAcceptance(type);
             }
 
-            if(type.equals(SdkType.FONTKIT)) {
+            if (type.equals(SdkType.FONTKIT)) {
                 File tmpTargetFile = File.createTempFile(UUID.randomUUID().toString(), "");
                 String tempSuffix = tmpTargetFile.getName().substring(tmpTargetFile.getName().lastIndexOf("-"));
-                if(!(tmpTargetFile.delete()))
-                {
+                if (!(tmpTargetFile.delete())) {
                     throw new IOException("Could not delete temp file: " + tmpTargetFile.getAbsolutePath());
                 }
 
                 File targetRootDir = new File(tmpTargetFile.getParentFile(), type.toString()
+ tempSuffix);
                 File targetDir = new File(targetRootDir, "/lib/external/optional");
-                if(!(targetDir.mkdirs()))
-                {
+                if (!(targetDir.mkdirs())) {
                     throw new IOException("Could not create temp directory: " + targetDir.getAbsolutePath());
                 }
 
-                final URI afeUri = new URI("http://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/lib/afe.jar?format=raw");
+                final URI afeUri = new URI("https://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/lib/afe.jar?format=raw");
                 final File afeFile = new File(targetDir, "afe.jar");
                 performSafeDownload(afeUri, afeFile);
 
-                final URI aglj40Uri = new URI("http://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/lib/aglj40.jar?format=raw");
+                final URI aglj40Uri = new URI("https://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/lib/aglj40.jar?format=raw");
                 final File aglj40File = new File(targetDir, "aglj40.jar");
                 performSafeDownload(aglj40Uri, aglj40File);
 
-                final URI rideauUri = new URI("http://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/lib/rideau.jar?format=raw");
+                final URI rideauUri = new URI("https://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/lib/rideau.jar?format=raw");
                 final File rideauFile = new File(targetDir, "rideau.jar");
                 performSafeDownload(rideauUri, rideauFile);
 
-                final URI flexFontkitUri = new URI("http://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/lib/flex-fontkit.jar?format=raw");
+                final URI flexFontkitUri = new URI("https://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/lib/flex-fontkit.jar?format=raw");
                 final File flexFontkitFile = new File(targetDir, "flex-fontkit.jar");
                 performSafeDownload(flexFontkitUri, flexFontkitFile);
 
@@ -134,7 +133,7 @@ public class DownloadRetriever extends BaseRetriever {
                     final File libDestFile = new File(targetDirectory, "frameworks/libs/player/"
+ version +
                             "/playerglobal.swc");
                     if (!libDestFile.getParentFile().exists()) {
-                        if(!libDestFile.getParentFile().mkdirs()) {
+                        if (!libDestFile.getParentFile().mkdirs()) {
                             throw new RetrieverException("Error creating directory " + libDestFile.getParent());
                         }
                     }
@@ -144,7 +143,7 @@ public class DownloadRetriever extends BaseRetriever {
                     System.out.println("Extracting archive to temp directory.");
                     File targetDirectory = new File(targetFile.getParent(),
                             targetFile.getName().substring(0, targetFile.getName().lastIndexOf(".")
- 1));
-                    if(type.equals(SdkType.SWFOBJECT)) {
+                    if (type.equals(SdkType.SWFOBJECT)) {
                         unpack(targetFile, new File(targetDirectory, "templates"));
                     } else {
                         unpack(targetFile, targetDirectory);
@@ -154,7 +153,7 @@ public class DownloadRetriever extends BaseRetriever {
                     System.out.println("===========================================================");
 
                     // In case of the swfobject, delete some stuff we don't want in there.
-                    if(type.equals(SdkType.SWFOBJECT)) {
+                    if (type.equals(SdkType.SWFOBJECT)) {
                         File delFile = new File(targetDirectory, "templates/swfobject/index_dynamic.html");
                         FileUtils.deleteQuietly(delFile);
                         delFile = new File(targetDirectory, "templates/swfobject/index.html");
@@ -172,6 +171,12 @@ public class DownloadRetriever extends BaseRetriever {
             throw new RetrieverException("Error downloading archive.", e);
         } catch (FileNotFoundException e) {
             throw new RetrieverException("Error downloading archive.", e);
+        } catch (SSLHandshakeException e) {
+            throw new RetrieverException("Error downloading archive. There were problems
in the SSL handshake. " +
+                    "In case of Sourceforge this is probably related to Sourceforge using
strong encryption for " +
+                    "SSL and the default Oracle JDK not supporting this. If you are able
to do so please install " +
+                    "the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction
Policy Files 8 available " +
+                    "from http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html",
e);
         } catch (IOException e) {
             throw new RetrieverException("Error downloading archive.", e);
         } catch (URISyntaxException e) {
@@ -289,7 +294,7 @@ public class DownloadRetriever extends BaseRetriever {
                     }
                     final ProgressBar progressBar = new ProgressBar(expectedSize);
                     long transferredSize = 0L;
-                    while ((expectedSize == 0) || (transferredSize < expectedSize)) {
+                    while (transferredSize < expectedSize) {
                         // Transfer about 1MB in each iteration.
                         long currentSize = fos.getChannel().transferFrom(rbc, transferredSize,
MEGABYTE);
                         if (currentSize < MEGABYTE) {


Mime
View raw message