From 1387e05a497147cd1a320c9651a47f122e942b93 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Mon, 09 Apr 2007 12:24:58 +0000
Subject: [PATCH] historical log for upgrader tool

---
 opends/src/quicksetup/org/opends/quicksetup/util/Utils.java |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index 18bbdf9..2ac5655 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -135,6 +135,25 @@
   }
 
   /**
+   * Creates a new file attempting to create the parent directories
+   * if necessary.
+   * @param f File to create
+   * @return boolean indicating whether the file was created; false otherwise
+   * @throws IOException if something goes wrong
+   */
+  public static boolean createFile(File f) throws IOException {
+    boolean success = false;
+    if (f != null) {
+      File parent = f.getParentFile();
+      if (!parent.exists()) {
+        parent.mkdirs();
+      }
+      success = f.createNewFile();
+    }
+    return success;
+  }
+
+  /**
    * Returns the absolute path for the given parentPath and relativePath.
    * @param parentPath the parent path.
    * @param relativePath the relative path.

--
Gitblit v1.10.0