Repository: jclouds Updated Branches: refs/heads/2.0.x 970f521bc -> d99350130
Avoid creating temporary files via relative paths This avoids creating junk in the source directory. Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/f2413cd1 Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/f2413cd1 Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/f2413cd1 Branch: refs/heads/2.0.x Commit: f2413cd19129b282ec21273871d9a0be84052041 Parents: 970f521 Author: Andrew Gaul <[email protected]> Authored: Mon Nov 7 10:43:32 2016 -0800 Committer: Andrew Gaul <[email protected]> Committed: Tue Nov 15 20:30:23 2016 -0800 ---------------------------------------------------------------------- .../swift/v1/blobstore/RegionScopedSwiftBlobStore.java | 2 +- .../RegionScopedSwiftBlobStoreParallelLiveTest.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds/blob/f2413cd1/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java ---------------------------------------------------------------------- diff --git a/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java b/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java index 66dd818..91d70c3 100644 --- a/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java +++ b/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java @@ -679,7 +679,7 @@ public class RegionScopedSwiftBlobStore implements BlobStore { ListeningExecutorService listeningExecutor = MoreExecutors.listeningDecorator(executor); RandomAccessFile raf = null; - File tempFile = new File(destination.getName() + "." + UUID.randomUUID()); + File tempFile = new File(destination + "." + UUID.randomUUID()); try { long contentLength = api .getObjectApi(regionId, container) http://git-wip-us.apache.org/repos/asf/jclouds/blob/f2413cd1/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java index 50e3ea9..7a99121 100644 --- a/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java +++ b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java @@ -56,7 +56,7 @@ import com.google.common.util.concurrent.MoreExecutors; @Test(groups = "live", singleThreaded = true) public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreIntegrationTest { - private final File BIG_FILE = new File("random.dat"); + private final File BIG_FILE; private final long SIZE = 10 * 1000 * 1000; private BlobStore blobStore; private String ETAG; @@ -71,6 +71,11 @@ public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreInt public RegionScopedSwiftBlobStoreParallelLiveTest() { provider = "openstack-swift"; + try { + BIG_FILE = File.createTempFile("random", "dat"); + } catch (IOException ioe) { + throw new RuntimeException(ioe); + } } // Override as needed for the right region @@ -121,7 +126,7 @@ public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreInt @Test(dependsOnMethods = "uploadMultipartBlob", singleThreaded = true) public void downloadParallelBlob() throws IOException { - final File downloadedFile = new File(BIG_FILE.getName() + ".downloaded"); + final File downloadedFile = new File(BIG_FILE + ".downloaded"); blobStore.downloadBlob(CONTAINER, BIG_FILE.getName(), downloadedFile, executor); String eTag = Files.hash(downloadedFile, Hashing.md5()).toString(); assertEquals(eTag, ETAG);
