You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/11/02 20:22:34 UTC

[1/2] git commit: updated refs/heads/master to 2cd789e

Repository: cloudstack
Updated Branches:
  refs/heads/master 7f1326c21 -> 2cd789e93


Use java.io.tmpdir instead of hardcoded /tmp

This was submitted earlier in PR #884 but that did not merge
properly.

This is a new PR with the same change.


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

Branch: refs/heads/master
Commit: ea92fc15ce2084ef701bf1af7069b6a7ec7013da
Parents: 901d47c
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Fri Oct 30 14:19:38 2015 +0100
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Sat Oct 31 12:03:11 2015 +0100

----------------------------------------------------------------------
 .../com/cloud/storage/template/LocalTemplateDownloader.java    | 2 +-
 .../cloud/storage/template/LocalTemplateDownloaderTest.java    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ea92fc15/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
index 3d33a21..564eba3 100644
--- a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
@@ -38,7 +38,7 @@ public class LocalTemplateDownloader extends TemplateDownloaderBase implements T
 
     public LocalTemplateDownloader(StorageLayer storageLayer, String downloadUrl, String toDir, long maxTemplateSizeInBytes, DownloadCompleteCallback callback) {
         super(storageLayer, downloadUrl, toDir, maxTemplateSizeInBytes, callback);
-        String filename = downloadUrl.substring(downloadUrl.lastIndexOf(File.separator));
+        String filename = new File(downloadUrl).getName();
         _toFile = toDir.endsWith(File.separator) ? (toDir + filename) : (toDir + File.separator + filename);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ea92fc15/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
----------------------------------------------------------------------
diff --git a/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java b/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
index 74d1adc..0a5d2f6 100644
--- a/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
+++ b/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
@@ -29,9 +29,9 @@ import org.junit.Test;
 public class LocalTemplateDownloaderTest {
 
     @Test
-    public void localTemplateDownloaderTest() {
-        String url =  "file://" + new File("pom.xml").getAbsolutePath();
-        TemplateDownloader td = new LocalTemplateDownloader(null, url, "/tmp", TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES, null);
+    public void localTemplateDownloaderTest() throws Exception {
+        String url = new File("pom.xml").toURI().toURL().toString();
+        TemplateDownloader td = new LocalTemplateDownloader(null, url, System.getProperty("java.io.tmpdir"), TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES, null);
         long bytes = td.download(true, null);
         if (!(bytes > 0)) {
             fail("Failed download");


[2/2] git commit: updated refs/heads/master to 2cd789e

Posted by re...@apache.org.
Merge pull request #1012 from wido/tmpdir-in-test

Use java.io.tmpdir instead of hardcoded /tmpThis was submitted earlier in PR #884 but that did not merge
properly.

This is a new PR with the same change.

* pr/1012:
  Use java.io.tmpdir instead of hardcoded /tmp

Signed-off-by: Remi Bergsma <gi...@remi.nl>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2cd789e9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2cd789e9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2cd789e9

Branch: refs/heads/master
Commit: 2cd789e93adb09537b3eaba1661db1cc35431b00
Parents: 7f1326c ea92fc1
Author: Remi Bergsma <gi...@remi.nl>
Authored: Mon Nov 2 20:22:16 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Mon Nov 2 20:22:16 2015 +0100

----------------------------------------------------------------------
 .../com/cloud/storage/template/LocalTemplateDownloader.java    | 2 +-
 .../cloud/storage/template/LocalTemplateDownloaderTest.java    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------