activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andytay...@apache.org
Subject [1/2] activemq-6 git commit: Replace file separate in ACTIVEMQ_HOME for Windows
Date Mon, 02 Mar 2015 13:49:39 GMT
Repository: activemq-6
Updated Branches:
  refs/heads/master 4152eba77 -> 9578e078d


Replace file separate in ACTIVEMQ_HOME for Windows

ActiveMQ uses URI's for locating files on a file system.  Absolute file
URIs are generated using an ACTIVEMQ_HOME variable defined via the start
up scripts.  For Windows this will contain "\" character as file path
separator.  This is invalid for the file URI scheme.  This patch
rewrites the ACTIVEMQ_HOME variable ensuring "/" are used on both
Windows and Linux.


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/9e4b40b0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/9e4b40b0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/9e4b40b0

Branch: refs/heads/master
Commit: 9e4b40b03374192a068eb05b7559c692de1b91b4
Parents: 2e0e662
Author: Martyn Taylor <mtaylor@redhat.com>
Authored: Mon Mar 2 12:18:32 2015 +0000
Committer: Martyn Taylor <mtaylor@redhat.com>
Committed: Mon Mar 2 12:25:14 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/activemq/cli/commands/Run.java  | 4 ++++
 .../src/main/java/org/apache/activemq/cli/commands/Stop.java | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/9e4b40b0/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java
index d898bfe..1acf05c 100644
--- a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java
+++ b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java
@@ -52,7 +52,11 @@ public class Run implements Action
 
       ActiveMQ.printBanner();
 
+      /* We use File URI for locating files.  The ACTIVEMQ_HOME variable is used to determine
file paths.  For Windows
+      the ACTIVEMQ_HOME variable will include back slashes (An invalid file URI character
path separator).  For this
+      reason we overwrite the ACTIVEMQ_HOME variable with backslashes replaced with forward
slashes. */
       String activemqHome = System.getProperty("activemq.home").replace("\\", "/");
+      System.setProperty("activemq.home", activemqHome);
 
       if (configuration == null)
       {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/9e4b40b0/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java
index da92f48..fab53e7 100644
--- a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java
+++ b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java
@@ -33,9 +33,15 @@ public class Stop implements Action
    @Override
    public Object execute(ActionContext context) throws Exception
    {
+      /* We use File URI for locating files.  The ACTIVEMQ_HOME variable is used to determine
file paths.  For Windows
+      the ACTIVEMQ_HOME variable will include back slashes (An invalid file URI character
path separator).  For this
+      reason we overwrite the ACTIVEMQ_HOME variable with backslashes replaced with forward
slashes. */
+      String activemqHome = System.getProperty("activemq.home").replace("\\", "/");
+      System.setProperty("activemq.home", activemqHome);
+
       if (configuration == null)
       {
-         configuration = "xml:" + System.getProperty("activemq.home").replace("\\", "/")
+ "/config/non-clustered/bootstrap.xml";
+         configuration = "xml:" + activemqHome + "/config/non-clustered/bootstrap.xml";
       }
       BrokerDTO broker = BrokerFactory.createBrokerConfiguration(configuration);
 


Mime
View raw message