syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1616249 - in /syncope/trunk: ./ installer/src/main/java/org/apache/syncope/installer/containers/ installer/src/main/java/org/apache/syncope/installer/containers/jboss/ installer/src/main/java/org/apache/syncope/installer/processes/ install...
Date Wed, 06 Aug 2014 14:32:37 GMT
Author: massi
Date: Wed Aug  6 14:32:37 2014
New Revision: 1616249

URL: http://svn.apache.org/r1616249
Log:
merge from branch

Modified:
    syncope/trunk/   (props changed)
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java

Propchange: syncope/trunk/
------------------------------------------------------------------------------
  Merged /syncope/branches/1_2_X:r1616139-1616248

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java?rev=1616249&r1=1616248&r2=1616249&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java
Wed Aug  6 14:32:37 2014
@@ -20,8 +20,12 @@ package org.apache.syncope.installer.con
 
 public abstract class AbstractContainer {
 
-    protected static final String CORE_RELATIVE_PATH = "%s/%s/core/target/syncope.war";
+    protected static final String UNIX_CORE_RELATIVE_PATH = "%s/%s/core/target/syncope.war";
 
-    protected static final String CONSOLE_RELATIVE_PATH = "%s/%s/console/target/syncope-console.war";
+    protected static final String WIN_CORE_RELATIVE_PATH = "%s\\%s\\core\\target\\syncope.war";
+
+    protected static final String UNIX_CONSOLE_RELATIVE_PATH = "%s/%s/console/target/syncope-console.war";
+
+    protected static final String WIN_CONSOLE_RELATIVE_PATH = "%s\\%s\\console\\target\\syncope-console.war";
 
 }

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java?rev=1616249&r1=1616248&r2=1616249&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java
Wed Aug  6 14:32:37 2014
@@ -30,11 +30,11 @@ public class Glassfish extends AbstractC
     }
 
     public String deployCore() {
-        return deploy(CORE_RELATIVE_PATH);
+        return deploy(UNIX_CORE_RELATIVE_PATH);
     }
 
     public String deployConsole() {
-        return deploy(CONSOLE_RELATIVE_PATH);
+        return deploy(UNIX_CONSOLE_RELATIVE_PATH);
     }
 
     public String deploy(final String what) {

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java?rev=1616249&r1=1616248&r2=1616249&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
Wed Aug  6 14:32:37 2014
@@ -25,17 +25,9 @@ import org.apache.syncope.installer.util
 
 public class Tomcat extends AbstractContainer {
 
-    private static final String UNIX_DEPLOY_SYNCOPE_CORE_QUERY
-            = "/manager/text/deploy?path=/syncope&war=file:" + CORE_RELATIVE_PATH;
+    private static final String DEPLOY_SYNCOPE_CORE_QUERY = "/manager/text/deploy?path=/syncope&war=file:";
 
-    private static final String WIN_DEPLOY_SYNCOPE_CORE_QUERY
-            = "/manager/text/deploy?path=/syncope&war=file:%s\\%s\\core\\target\\syncope.war";
-
-    private static final String UNIX_DEPLOY_SYNCOPE_CONSOLE_QUERY
-            = "/manager/text/deploy?path=/syncope-console&war=file:" + CONSOLE_RELATIVE_PATH;
-
-    private static final String WIN_DEPLOY_SYNCOPE_CONSOLE_QUERY
-            = "/manager/text/deploy?path=/syncope-console&war=file:%s\\%s\\console\\target\\syncope-console.war";
+    private static final String DEPLOY_SYNCOPE_CONSOLE_QUERY = "/manager/text/deploy?path=/syncope-console&war=file:";
 
     private final String installPath;
 
@@ -53,9 +45,10 @@ public class Tomcat extends AbstractCont
     public boolean deployCore() {
         int status;
         if (FileSystemUtils.IS_WIN) {
-            status = httpUtils.getWithBasicAuth(pathEncoded(WIN_DEPLOY_SYNCOPE_CORE_QUERY));
+            status = httpUtils.getWithBasicAuth(DEPLOY_SYNCOPE_CORE_QUERY
+                    + pathEncoded(String.format(WIN_CORE_RELATIVE_PATH, installPath, artifactId)));
         } else {
-            status = httpUtils.getWithBasicAuth(path(UNIX_DEPLOY_SYNCOPE_CORE_QUERY));
+            status = httpUtils.getWithBasicAuth(path(DEPLOY_SYNCOPE_CORE_QUERY + UNIX_CORE_RELATIVE_PATH));
         }
 
         return status == 200;
@@ -64,24 +57,25 @@ public class Tomcat extends AbstractCont
     public boolean deployConsole() {
         int status;
         if (FileSystemUtils.IS_WIN) {
-            status = httpUtils.getWithBasicAuth(pathEncoded(WIN_DEPLOY_SYNCOPE_CONSOLE_QUERY));
+            status = httpUtils.getWithBasicAuth(DEPLOY_SYNCOPE_CONSOLE_QUERY
+                    + pathEncoded(String.format(WIN_CONSOLE_RELATIVE_PATH, installPath, artifactId)));
         } else {
-            status = httpUtils.getWithBasicAuth(path(UNIX_DEPLOY_SYNCOPE_CONSOLE_QUERY));
+            status = httpUtils.getWithBasicAuth(path(DEPLOY_SYNCOPE_CONSOLE_QUERY + UNIX_CONSOLE_RELATIVE_PATH));
         }
 
         return status == 200;
     }
 
-    public String pathEncoded(final String what) {
+    private String pathEncoded(final String what) {
         String path = "";
         try {
-            path = URLEncoder.encode(String.format(what, installPath, artifactId), "UTF-8");
+            path = URLEncoder.encode(what, "UTF-8");
         } catch (UnsupportedEncodingException uee) {
         }
         return path;
     }
 
-    public String path(final String what) {
+    private String path(final String what) {
         return String.format(what, installPath, artifactId);
     }
 }

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java?rev=1616249&r1=1616248&r2=1616249&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
Wed Aug  6 14:32:37 2014
@@ -53,11 +53,11 @@ public class JBoss extends AbstractConta
     }
 
     public boolean deployCore() {
-        return deploy(CORE_RELATIVE_PATH, "syncope.war");
+        return deploy(UNIX_CORE_RELATIVE_PATH, "syncope.war");
     }
 
     public boolean deployConsole() {
-        return deploy(CONSOLE_RELATIVE_PATH, "syncope-console.war");
+        return deploy(UNIX_CONSOLE_RELATIVE_PATH, "syncope-console.war");
     }
 
     public boolean deploy(final String whatDeploy, final String warName) {

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java?rev=1616249&r1=1616248&r2=1616249&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
Wed Aug  6 14:32:37 2014
@@ -43,17 +43,17 @@ public class ArchetypeProcess {
         if (!new File(installPath).exists()) {
             FileSystemUtils.createDirectory(installPath, handler, null);
         }
-        
+
         final MavenUtils mavenUtils = new MavenUtils(mavenDir);
-        
+
         mavenUtils.archetypeGenerate(
                 syncopeVersion, groupId, artifactId, secretKey, anonymousKey, installPath);
 
         FileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + Pom.PATH),
                 String.format(Pom.FILE, syncopeVersion, syncopeVersion, groupId, artifactId));
 
+        FileSystemUtils.createDirectory(confDirectory, handler, null);
         FileSystemUtils.createDirectory(logsDirectory, handler, null);
-
         FileSystemUtils.createDirectory(bundlesDirectory, handler, null);
 
         mavenUtils.createPackage(installPath + "/" + artifactId, confDirectory, logsDirectory,
bundlesDirectory);

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java?rev=1616249&r1=1616248&r2=1616249&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
Wed Aug  6 14:32:37 2014
@@ -78,7 +78,7 @@ public class MavenUtils {
 
     private Properties packageProperties(final String confDirectory, final String logDirectory,
             final String bundlesDirectory) {
-        Properties properties = new Properties();
+        final Properties properties = new Properties();
         properties.setProperty("conf.directory", confDirectory);
         properties.setProperty("log.directory", logDirectory);
         properties.setProperty("bundles.directory", bundlesDirectory);



Mime
View raw message