You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/05/21 03:59:23 UTC

[04/50] [abbrv] git commit: ACCUMULO-2811: Move directory creation to the constructor so that the directory creation is only attempted once. Check that the directory does not exist first.

ACCUMULO-2811: Move directory creation to the constructor so that the directory creation is only attempted once. Check that the directory does not exist first.


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

Branch: refs/heads/ACCUMULO-378
Commit: fd80bc61573fa18fe3439b94b4334c3a91e16420
Parents: ff17423
Author: Dave Marion <dl...@hotmail.com>
Authored: Thu May 15 20:14:43 2014 -0400
Committer: Dave Marion <dl...@hotmail.com>
Committed: Thu May 15 20:14:43 2014 -0400

----------------------------------------------------------------------
 .../accumulo/start/classloader/vfs/UniqueFileReplicator.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/fd80bc61/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
index 29407f9..e11cf47 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
@@ -46,6 +46,8 @@ public class UniqueFileReplicator implements VfsComponent, FileReplicator {
 
   public UniqueFileReplicator(File tempDir) {
     this.tempDir = tempDir;
+    if (!tempDir.exists() && !tempDir.mkdirs())
+      log.warn("Unexpected error creating directory " + tempDir);
   }
 
   @Override
@@ -53,8 +55,6 @@ public class UniqueFileReplicator implements VfsComponent, FileReplicator {
     String baseName = srcFile.getName().getBaseName();
 
     try {
-      if (!tempDir.mkdirs())
-        log.warn("Unexpected error creating directory " + tempDir);
       String safeBasename = UriParser.encode(baseName, TMP_RESERVED_CHARS).replace('%', '_');
       File file = File.createTempFile("vfsr_", "_" + safeBasename, tempDir);
       file.deleteOnExit();