netbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geert...@apache.org
Subject [incubator-netbeans] branch master updated: [NETBEANS-997] Fix for unable to download and create GlassFish server / support for installing GF 4.1.2 & GF 5.0
Date Tue, 12 Feb 2019 16:24:45 GMT
This is an automated email from the ASF dual-hosted git repository.

geertjan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new d86e062  [NETBEANS-997] Fix for unable to download and create GlassFish server /
support for installing GF 4.1.2 & GF 5.0
     new dff7052  Merge pull request #1119 from peedeeboy/NETBEANS-997
d86e062 is described below

commit d86e0628849783f66b597859baf188cf254c0375
Author: Pete Whelpton <peedeeboy@gmail.com>
AuthorDate: Sun Feb 3 11:49:12 2019 +0000

    [NETBEANS-997] Fix for unable to download and create GlassFish server / support for installing
GF 4.1.2 & GF 5.0
---
 .../modules/glassfish/common/Bundle.properties     |  1 +
 .../modules/glassfish/common/ServerDetails.java    | 60 +++++++++++++---------
 .../wizards/AddServerLocationVisualPanel.java      |  4 +-
 .../glassfish/common/wizards/Retriever.java        | 18 ++-----
 .../test/unit/data/nottaDir-4_1_2.jar              |  1 +
 .../test/unit/data/subdir/nottaDir-5.0.jar         |  1 +
 .../glassfish/common/wizards/RetrieverTest.java    | 43 ++++------------
 .../glassfish/common/wizards/TestServer.java       | 39 +++++++-------
 .../glassfish/tooling/data/GlassFishVersion.java   |  8 +++
 9 files changed, 84 insertions(+), 91 deletions(-)

diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties
b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties
index d5069fa..2e7616f 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties
@@ -154,6 +154,7 @@ STR_40_SERVER_NAME=GlassFish Server 4.0
 STR_401_SERVER_NAME=GlassFish Server 4.0.1
 STR_41_SERVER_NAME=GlassFish Server 4.1
 STR_411_SERVER_NAME=GlassFish Server 4.1.1
+STR_412_SERVER_NAME=GlassFish Server 4.1.2
 STR_50_SERVER_NAME=GlassFish Server 5.0
 
 # CommonServerSupport.java
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java
b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java
index b2152ed..669f324 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java
@@ -56,8 +56,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_3(NbBundle.getMessage(ServerDetails.class,"STR_3_SERVER_NAME", new Object[]{}),
// NOI18N
         "deployer:gfv3ee6", // NOI18N
         300,
-        "http://download.java.net/glassfish/v3/release/glassfish-v3.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post701v3.txt" // NOI18N
+        "https://download.oracle.com/glassfish/v3/release/glassfish-v3.zip", // NOI18N
+        "https://download.oracle.com/glassfish/v3/release/glassfish-v3.zip" // NOI18N
     ),
     /**
      * details for an instance of GlassFish Server 3.0/3.0.x
@@ -65,8 +65,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_3_0_1(NbBundle.getMessage(ServerDetails.class,"STR_301_SERVER_NAME",
new Object[]{}), // NOI18N
         "deployer:gfv3ee6", // NOI18N
         301,
-        "http://download.java.net/glassfish/3.0.1/release/glassfish-3.0.1-ml.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post701v3-0-1.txt" // NOI18N
+        "https://download.oracle.com/glassfish/3.0.1/release/glassfish-3.0.1-ml.zip", //
NOI18N
+        "https://download.oracle.com/glassfish/3.0.1/release/glassfish-3.0.1-ml.zip" // NOI18N
     ),
     /**
      * details for an instance of GlassFish Server 3.1
@@ -74,8 +74,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_3_1(NbBundle.getMessage(ServerDetails.class, "STR_31_SERVER_NAME", new
Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         310,
-        "http://download.java.net/glassfish/3.1/release/glassfish-3.1-ml.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post701v3-1.txt" // NOI18N
+        "https://download.oracle.com/glassfish/3.1/release/glassfish-3.1-ml.zip", // NOI18N
+        "https://download.oracle.com/glassfish/3.1/release/glassfish-3.1-ml.zip" // NOI18N
     ),
     /**
      * details for an instance of GlassFish Server 3.1.1
@@ -83,8 +83,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_3_1_1(NbBundle.getMessage(ServerDetails.class, "STR_311_SERVER_NAME",
new Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         311,
-        "http://download.java.net/glassfish/3.1.1/release/glassfish-3.1.1-ml.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post701v3-1-1.txt" // NOI18N
+        "https://download.oracle.com/glassfish/3.1.1/release/glassfish-3.1.1-ml.zip", //
NOI18N
+        "https://download.oracle.com/glassfish/3.1.1/release/glassfish-3.1.1-ml.zip" // NOI18N
             ),
     /**
      * details for an instance of GlassFish Server 3.1.2
@@ -92,8 +92,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_3_1_2(NbBundle.getMessage(ServerDetails.class, "STR_312_SERVER_NAME",
new Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         312,
-        "http://download.java.net/glassfish/3.1.2/release/glassfish-3.1.2-ml.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post71v3-1-2.txt" // NOI18N
+        "https://download.oracle.com/glassfish/3.1.2/release/glassfish-3.1.2-ml.zip", //
NOI18N
+        "https://download.oracle.com/glassfish/3.1.2/release/glassfish-3.1.2-ml.zip" // NOI18N
     ),
 
     /**
@@ -102,8 +102,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_3_1_2_2(NbBundle.getMessage(ServerDetails.class, "STR_3122_SERVER_NAME",
new Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         312,
-        "http://download.java.net/glassfish/3.1.2.2/release/glassfish-3.1.2.2-ml.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post71v3-1-2.txt" // NOI18N
+        "https://download.oracle.com/glassfish/3.1.2.2/release/glassfish-3.1.2.2-ml.zip",
// NOI18N
+        "https://download.oracle.com/glassfish/3.1.2.2/release/glassfish-3.1.2.2-ml.zip"
// NOI18N
     ),
 
     /**
@@ -112,8 +112,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_4_0(NbBundle.getMessage(ServerDetails.class, "STR_40_SERVER_NAME", new
Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         400,
-        "http://download.java.net/glassfish/4.0/release/glassfish-4.0-ml.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post71v4-0.txt" // NOI18N
+        "https://download.oracle.com/glassfish/4.0/release/glassfish-4.0-ml.zip", // NOI18N
+        "https://download.oracle.com/glassfish/4.0/release/glassfish-4.0-ml.zip" // NOI18N
     ),
 
     /**
@@ -122,8 +122,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_4_0_1(NbBundle.getMessage(ServerDetails.class, "STR_401_SERVER_NAME",
new Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         401,
-        "http://download.java.net/glassfish/4.0.1/release/glassfish-4.0.1-ml.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post71v4-0-1.txt" // NOI18N
+        "https://download.oracle.com/glassfish/4.0.1/release/glassfish-4.0.1-ml.zip", //
NOI18N
+        "https://download.oracle.com/glassfish/4.0.1/release/glassfish-4.0.1-ml.zip" // NOI18N
     ),
     
     /**
@@ -132,8 +132,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_4_1(NbBundle.getMessage(ServerDetails.class, "STR_41_SERVER_NAME", new
Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         410,
-        "http://download.java.net/glassfish/4.1/release/glassfish-4.1.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post71v4-1.txt" // NOI18N
+        "https://download.oracle.com/glassfish/4.1/release/glassfish-4.1.zip", // NOI18N
+        "https://download.oracle.com/glassfish/4.1/release/glassfish-4.1.zip" // NOI18N
     ),
 
     /**
@@ -142,8 +142,18 @@ public enum ServerDetails {
     GLASSFISH_SERVER_4_1_1(NbBundle.getMessage(ServerDetails.class, "STR_411_SERVER_NAME",
new Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         411,
-        "http://download.java.net/glassfish/4.1.1/release/glassfish-4.1.1.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post71v4-1-1.txt" // NOI18N
+        "https://download.oracle.com/glassfish/4.1.1/release/glassfish-4.1.1.zip", // NOI18N
+        "https://download.oracle.com/glassfish/4.1.1/release/glassfish-4.1.1.zip" // NOI18N
+    ),
+    
+    /**
+     * details for an instance of GlassFish Server 4.1.2
+     */
+    GLASSFISH_SERVER_4_1_2(NbBundle.getMessage(ServerDetails.class, "STR_412_SERVER_NAME",
new Object[]{}), // NOI18N
+        "deployer:gfv3ee6wc", // NOI18N
+        412,
+        "https://download.oracle.com/glassfish/4.1.2/release/glassfish-4.1.2.zip", // NOI18N
+        "https://download.oracle.com/glassfish/4.1.2/release/glassfish-4.1.2.zip" // NOI18N
     ),
     
     /**
@@ -152,8 +162,8 @@ public enum ServerDetails {
     GLASSFISH_SERVER_5_0(NbBundle.getMessage(ServerDetails.class, "STR_50_SERVER_NAME", new
Object[]{}), // NOI18N
         "deployer:gfv3ee6wc", // NOI18N
         500,
-        "http://download.java.net/glassfish/5.0/release/glassfish-5.0.zip?nbretriever=fallback",
// NOI18N
-        "http://serverplugins.netbeans.org/glassfishv3/post71v5-0.txt" // NOI18N
+        "https://download.oracle.com/glassfish/5.0/release/glassfish-5.0.zip", // NOI18N
+        "https://download.oracle.com/glassfish/5.0/release/glassfish-5.0.zip" // NOI18N
     );
 
     /**
@@ -166,6 +176,7 @@ public enum ServerDetails {
             getInstantiatingIterator() {
         return new ServerWizardIterator(new ServerDetails[]{
                     GLASSFISH_SERVER_5_0,
+                    GLASSFISH_SERVER_4_1_2,
                     GLASSFISH_SERVER_4_1_1,
                     GLASSFISH_SERVER_4_1,
                     GLASSFISH_SERVER_4_0_1,
@@ -177,8 +188,8 @@ public enum ServerDetails {
                     GLASSFISH_SERVER_3_0_1,
                     GLASSFISH_SERVER_3,},
                 new ServerDetails[]{
-                    // not yet
-                    //GLASSFISH_SERVER_5_0, 
+                    GLASSFISH_SERVER_5_0,
+                    GLASSFISH_SERVER_4_1_2,
                     GLASSFISH_SERVER_4_1_1,
                     GLASSFISH_SERVER_4_1,
                     GLASSFISH_SERVER_4_0,
@@ -213,6 +224,7 @@ public enum ServerDetails {
                 case GF_4_0_1:   return GLASSFISH_SERVER_4_0_1.getVersion();
                 case GF_4_1:     return GLASSFISH_SERVER_4_1.getVersion();
                 case GF_4_1_1:   return GLASSFISH_SERVER_4_1_1.getVersion();
+                case GF_4_1_2:   return GLASSFISH_SERVER_4_1_2.getVersion();
                 case GF_5:       return GLASSFISH_SERVER_5_0.getVersion();
                 default:         return -1;
             }
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/AddServerLocationVisualPanel.java
b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/AddServerLocationVisualPanel.java
index 5c689cf..5174b30 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/AddServerLocationVisualPanel.java
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/AddServerLocationVisualPanel.java
@@ -48,7 +48,7 @@ public class AddServerLocationVisualPanel extends javax.swing.JPanel implements
     public static enum DownloadState { AVAILABLE, DOWNLOADING, COMPLETED };
 
     // expose for qa-functional tests
-    public static final String V3_DOWNLOAD_PREFIX = "http://download.java.net/"; // NOI18N
+    public static final String V3_DOWNLOAD_PREFIX = "https://download.oracle.com/"; // NOI18N
     
     private final List<ChangeListener> listeners = new CopyOnWriteArrayList<ChangeListener>();
     private Retriever retriever;
@@ -427,7 +427,7 @@ public class AddServerLocationVisualPanel extends javax.swing.JPanel implements
 private void readlicenseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_readlicenseButtonActionPerformed
         try {
             URLDisplayer.getDefault().showURL(
-                    new URL("http://glassfish.java.net/public/CDDL+GPL.html")); //NOI18N
+                    new URL("https://javaee.github.io/glassfish/LICENSE")); //NOI18N
         } catch (Exception ex){
             Logger.getLogger("glassfish").log(Level.INFO, ex.getLocalizedMessage(), ex);
         }
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Retriever.java
b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Retriever.java
index 394aad1..1618b61 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Retriever.java
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Retriever.java
@@ -327,7 +327,6 @@ public class Retriever implements Runnable {
         boolean run = true;
         while(run) {
             URLConnection conn;
-            BufferedReader in = null;
             try {
                 URL url = new URL(location);
                 conn = url.openConnection();
@@ -335,6 +334,7 @@ public class Retriever implements Runnable {
                     HttpURLConnection hconn = (HttpURLConnection) conn;
                     hconn.setConnectTimeout(LOCATION_DOWNLOAD_TIMEOUT);
                     hconn.setReadTimeout(LOCATION_DOWNLOAD_TIMEOUT);
+                    hconn.setRequestMethod("HEAD");
                     if (hconn instanceof HttpsURLConnection) {
                         handleSecureConnection((HttpsURLConnection)hconn);
                     }
@@ -355,11 +355,9 @@ public class Retriever implements Runnable {
                             }
                             break;
                         case 200:
-                            in = new BufferedReader(new InputStreamReader(
-                                    hconn.getInputStream()));
-                            String path;
-                            if ((path = in.readLine()) != null) {
-                                result = targetUrlPrefix + path;
+                            int len = hconn.getContentLength();
+                            if (len > 0) {
+                                result = location;
                                 LOGGER.log(Level.FINE,
                                         "New Glassfish Location: {0}", result);
                             }
@@ -376,14 +374,6 @@ public class Retriever implements Runnable {
             } catch (IOException ioe) {
                 LOGGER.log(Level.INFO, "Error reading from URL", ioe);
                 run = false;
-            } finally {
-                if (in != null) {
-                    try {
-                        in.close();
-                    } catch (IOException ioe) {
-                        LOGGER.log(Level.INFO, "Cannot close URL reader", ioe);
-                    }
-                }
             }
         }
         return result;
diff --git a/enterprise/glassfish.common/test/unit/data/nottaDir-4_1_2.jar b/enterprise/glassfish.common/test/unit/data/nottaDir-4_1_2.jar
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/enterprise/glassfish.common/test/unit/data/nottaDir-4_1_2.jar
@@ -0,0 +1 @@
+
diff --git a/enterprise/glassfish.common/test/unit/data/subdir/nottaDir-5.0.jar b/enterprise/glassfish.common/test/unit/data/subdir/nottaDir-5.0.jar
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/enterprise/glassfish.common/test/unit/data/subdir/nottaDir-5.0.jar
@@ -0,0 +1 @@
+
diff --git a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/RetrieverTest.java
b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/RetrieverTest.java
index e475f0b..c28fc97 100644
--- a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/RetrieverTest.java
+++ b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/RetrieverTest.java
@@ -85,7 +85,8 @@ public class RetrieverTest implements Retriever.Updater {
             try {
                 message = "";
                 status = "";
-                r = new Retriever(file, "http://localhost:" + server.getPort() + "/glassfishv3/preludezipfilename.txt",
+                // Test 301 redirect
+                r = new Retriever(file, "http://localhost:" + server.getPort() + "/glassfishv3/moved.zip",
                         "http://localhost:" + server.getPort() + "/",
                         "http://localhost:" + server.getPort() + "/glassfish/v3-prelude/release/glassfish-v3-prelude-ml.zip",
this,
                         "glassfishv3");
@@ -97,12 +98,12 @@ public class RetrieverTest implements Retriever.Updater {
             } finally {
                 deleteJunk(file);
             }
-
+            
             try {
                 message = "";
                 status = "";
-                // bad location source url -- falls back to the default url
-                r = new Retriever(file, "http://localhost:" + server.getPort() + "/glassfishv3/preludezipfilename.tx",
+                // Test indirect download location correct
+                r = new Retriever(file, "http://localhost:" + server.getPort() + "/glassfishv3/preludezipfilename.txt",
                         "http://localhost:" + server.getPort() + "/",
                         "http://localhost:" + server.getPort() + "/glassfish/v3-prelude/release/glassfish-v3-prelude-ml.zip",
this,
                         "glassfishv3");
@@ -114,42 +115,20 @@ public class RetrieverTest implements Retriever.Updater {
             } finally {
                 deleteJunk(file);
             }
-
+            
             try {
                 message = "";
                 status = "";
-                // bad url prefix
-                r = new Retriever(file, "http://localhost:" + server.getPort() + "/glassfishv3/preludezipfilename.txt",
-                        "http://java.tent/download/",
+                // bad location source url -- falls back to the default url
+                r = new Retriever(file, "http://localhost:" + server.getPort() + "/glassfishv3/preludezipfilename.tx",
+                        "http://localhost:" + server.getPort() + "/",
                         "http://localhost:" + server.getPort() + "/glassfish/v3-prelude/release/glassfish-v3-prelude-ml.zip",
this,
                         "glassfishv3");
                 r.run();
                 System.out.println("message="+message);
                 System.out.println("status="+status);
-                assert message.startsWith("Invalid URL: http://java.tent/download/glassfish/v3-prelude/release/glassfish-v3-prelude-ml.zip")
: message;
-                assert status.startsWith("I/O Exception: ") : status;
-            } finally {
-                deleteJunk(file);
-            }
-
-            try {
-                message = "";
-                status = "";
-                // bad url prefix
-                r = new Retriever(file,"http://localhost:" + server.getPort() + "/glassfishv3/preludezipfilename.tx",
-                        "http://java.tent/download/",
-                        "http://download.java.net/glassfish/v3-FFFprelude/release/glassfish-v3-prelude-ml.zip",
this,
-                        "glassfishv3");
-                r.run();
-                System.out.println("message="+message);
-                System.out.println("status="+status);
-                assert message.startsWith("Invalid URL: http://") || 
-                        message.startsWith("Connecting...") : message;
-                assert status.startsWith("I/O Exception: http://") ||
-                        status.startsWith("I/O Exception: connect timed out") ||
-                        status.startsWith("I/O Exception: java.net") ||
-                        status.startsWith("I/O Exception: Connection reset") ||
-                        status.startsWith("Connection Exception: Connection timed out") :
status ;
+                assert message.startsWith("Download & Install completed in") : message;
+                assert status.equals("") : status;
             } finally {
                 deleteJunk(file);
             }
diff --git a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/TestServer.java
b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/TestServer.java
index e7c4a7c..fed5b6e 100644
--- a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/TestServer.java
+++ b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/TestServer.java
@@ -97,7 +97,7 @@ public class TestServer {
 
     private static class ServerThread extends Thread {
 
-        private static final Pattern HTTP_PATTERN = Pattern.compile("GET (/[^\\s]*) HTTP/1\\.[01]");
+        private static final Pattern HTTP_PATTERN = Pattern.compile("(GET|HEAD) (/[^\\s]*)
HTTP/1\\.[01]");
         private final Socket socket;
 
         public ServerThread(Socket socket) {
@@ -118,20 +118,19 @@ public class TestServer {
                                     break;
                                 }
                             }
-                            String resource = matcher.group(1);
-                            if (resource.endsWith(".txt")) {
+                            String httpVerb = matcher.group(1);
+                            String resource = matcher.group(2);
+                            if (resource.endsWith("moved.zip")) {
                                 PrintWriter out = new PrintWriter(socket.getOutputStream(),
true);
                                 try {
-                                    out.print("HTTP/1.0 200 OK\r\n");
-                                    out.print("Content-Type: text/plain\r\n");
-                                    out.print("Connection: close\r\n");
+                                    out.print("HTTP/1.0 301 Moved Permanently\r\n");
+                                    out.print("Location: http://localhost:4444/glassfish/v3-prelude/release/glassfish-v3-prelude-ml.zip\r\n");
                                     out.print("\r\n");
-                                    out.print("glassfish/v3-prelude/release/glassfish-v3-prelude-ml.zip\r\n");
                                     out.flush();
                                 } finally {
                                     out.close();
                                 }
-                            } else if (resource.endsWith(".zip")) {
+                            } else if (resource.endsWith("prelude-ml.zip")) {
                                 OutputStream rawOut = new BufferedOutputStream(socket.getOutputStream());
                                 try {
                                     PrintWriter out = new PrintWriter(rawOut, true);
@@ -141,15 +140,17 @@ public class TestServer {
                                         out.print("Connection: close\r\n");
                                         out.print("\r\n");
                                         out.flush();
-                                        ZipOutputStream zip = new ZipOutputStream(rawOut);
-                                        try {
-                                            writeFile(zip, "gf_fake.jar", 1024 * 1024 * 10);
-                                            writeFile(zip, "test/gf_fake_lib.jar", 1024 *
1024 * 5);
-                                            zip.flush();
-                                            zip.finish();
-                                        } finally {
-                                            zip.close();
-                                        }
+                                        if(httpVerb.equals("GET")) {
+                                            ZipOutputStream zip = new ZipOutputStream(rawOut);
+                                            try {
+                                                writeFile(zip, "gf_fake.jar", 1024 * 1024
* 10);
+                                                writeFile(zip, "test/gf_fake_lib.jar", 1024
* 1024 * 5);
+                                                zip.flush();
+                                                zip.finish();
+                                            } finally {
+                                                zip.close();
+                                            }
+                                        }   
                                     } finally {
                                         out.close();
                                     }
@@ -174,8 +175,8 @@ public class TestServer {
                         in.close();
                     } finally {
                         socket.close();
-                    }
-                }
+                        }    
+                      }
             } catch (IOException ex) {
                 throw new RuntimeException(ex);
             }
diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java
b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java
index 272fcc8..e20a52a 100644
--- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java
+++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java
@@ -72,6 +72,8 @@ public enum GlassFishVersion {
     GF_4_1      ((short) 4, (short) 1, (short) 0, (short) 0, GlassFishVersion.GF_4_1_STR),
     /** GlassFish 4.1.1. */
     GF_4_1_1    ((short) 4, (short) 1, (short) 1, (short) 0, GlassFishVersion.GF_4_1_1_STR),
+    /** GlassFish 4.1.2. */
+    GF_4_1_2    ((short) 4, (short) 1, (short) 1, (short) 2, GlassFishVersion.GF_4_1_2_STR),
     /** GlassFish 5. */
     GF_5        ((short) 5, (short) 0, (short) 0, (short) 0, GlassFishVersion.GF_5_STR);
 
@@ -165,6 +167,11 @@ public enum GlassFishVersion {
     /** Additional <code>String</code> representations of GF_4_1 value. */
     static final String GF_4_1_1_STR_NEXT[] = {"4.1.1.0"};
 
+    /**  A <code>String</code> representation of GF_4_1_2 value. */
+    static final String GF_4_1_2_STR = "4.1.2";
+    /** Additional <code>String</code> representations of GF_4_1_2 value. */
+    static final String GF_4_1_2_STR_NEXT[] = {"4.1.2.0"};
+    
     /**  A <code>String</code> representation of GF_5 value. */
     static final String GF_5_STR = "5";
     /** Additional <code>String</code> representations of GF_5 value. */
@@ -195,6 +202,7 @@ public enum GlassFishVersion {
         initStringValuesMapFromArray(GF_4_0_1, GF_4_0_1_STR_NEXT);
         initStringValuesMapFromArray(GF_4_1, GF_4_1_STR_NEXT);
         initStringValuesMapFromArray(GF_4_1_1, GF_4_1_1_STR_NEXT);
+        initStringValuesMapFromArray(GF_4_1_2, GF_4_1_2_STR_NEXT);
         initStringValuesMapFromArray(GF_5, GF_5_STR_NEXT);
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Mime
View raw message