You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by dr...@apache.org on 2017/10/02 15:04:57 UTC

[1/3] brooklyn-server git commit: Handle empty-dir for `bundleMaker.createJarFromClasspathDir`

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 0adf3fdd9 -> e2c0247b6


Handle empty-dir for `bundleMaker.createJarFromClasspathDir`

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/c2f7cdce
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/c2f7cdce
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/c2f7cdce

Branch: refs/heads/master
Commit: c2f7cdceba0cdd7cd04673903f1d4fce5e092ee6
Parents: 0adf3fd
Author: Aled Sage <al...@gmail.com>
Authored: Mon Oct 2 14:49:04 2017 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Oct 2 14:49:04 2017 +0100

----------------------------------------------------------------------
 .../org/apache/brooklyn/util/core/osgi/BundleMaker.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c2f7cdce/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java b/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java
index 65b3aec..d87bcf8 100644
--- a/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java
+++ b/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java
@@ -359,7 +359,14 @@ public class BundleMaker {
         if (startPos<0) {
             throw new IllegalStateException("URL of "+item+" does not appear relative to root "+root);
         }
-        String itemE = item.substring(startPos + root.length()+1);
+        String itemE = item.substring(startPos + root.length());
+        itemE = Strings.removeFromStart(itemE, "/");
+        
+        if (Strings.isEmpty(itemE)) {
+            // Can happen if we're given an empty folder. addUrlDirToZipRecursively will have returned false, so 
+            // will try to add it as a file.
+            return; 
+        }
         if (!filter.apply(itemE)) {
             return;
         }


[2/3] brooklyn-server git commit: BundleMaker: test with empty file

Posted by dr...@apache.org.
BundleMaker: test with empty file

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/5e30bd19
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/5e30bd19
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/5e30bd19

Branch: refs/heads/master
Commit: 5e30bd19bfca8bc22f7f0fa8369103e410755638
Parents: c2f7cdc
Author: Aled Sage <al...@gmail.com>
Authored: Mon Oct 2 14:49:26 2017 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Oct 2 14:49:26 2017 +0100

----------------------------------------------------------------------
 .../org/apache/brooklyn/util/core/osgi/BundleMakerTest.java  | 8 +++++++-
 .../core/osgi/test/bundlemaker/withmanifest/myemptyfile.txt  | 0
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5e30bd19/core/src/test/java/org/apache/brooklyn/util/core/osgi/BundleMakerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/util/core/osgi/BundleMakerTest.java b/core/src/test/java/org/apache/brooklyn/util/core/osgi/BundleMakerTest.java
index f9c1737..2e905e9 100644
--- a/core/src/test/java/org/apache/brooklyn/util/core/osgi/BundleMakerTest.java
+++ b/core/src/test/java/org/apache/brooklyn/util/core/osgi/BundleMakerTest.java
@@ -209,7 +209,13 @@ public class BundleMakerTest extends BrooklynMgmtUnitTestSupport {
                 "Manifest-Version: 1.2.3\r\n" + 
                 "mykey: myval\r\n" +
                 "\r\n";
-        assertJarContents(generatedJar, ImmutableMap.of(JarFile.MANIFEST_NAME, expectedManifest, "myfile.txt", "mytext", "subdir/myfile2.txt", "mytext2"), false);
+        assertJarContents(generatedJar, 
+                ImmutableMap.of(
+                        JarFile.MANIFEST_NAME, expectedManifest,
+                        "myfile.txt", "mytext",
+                        "myemptyfile.txt", "", 
+                        "subdir/myfile2.txt", "mytext2"),
+                false);
     }
     
     @SuppressWarnings("deprecation")

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5e30bd19/core/src/test/resources/org/apache/brooklyn/util/core/osgi/test/bundlemaker/withmanifest/myemptyfile.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/brooklyn/util/core/osgi/test/bundlemaker/withmanifest/myemptyfile.txt b/core/src/test/resources/org/apache/brooklyn/util/core/osgi/test/bundlemaker/withmanifest/myemptyfile.txt
new file mode 100644
index 0000000..e69de29


[3/3] brooklyn-server git commit: This closes #850

Posted by dr...@apache.org.
This closes #850


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e2c0247b
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e2c0247b
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e2c0247b

Branch: refs/heads/master
Commit: e2c0247b6d2515561a34e94dc9e2e8078ac7fb00
Parents: 0adf3fd 5e30bd1
Author: Duncan Godwin <dr...@googlemail.com>
Authored: Mon Oct 2 16:04:50 2017 +0100
Committer: Duncan Godwin <dr...@googlemail.com>
Committed: Mon Oct 2 16:04:50 2017 +0100

----------------------------------------------------------------------
 .../org/apache/brooklyn/util/core/osgi/BundleMaker.java     | 9 ++++++++-
 .../org/apache/brooklyn/util/core/osgi/BundleMakerTest.java | 8 +++++++-
 .../core/osgi/test/bundlemaker/withmanifest/myemptyfile.txt | 0
 3 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------