[hornetq-commits] JBoss hornetq SVN: r12042 - trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jan 23 07:00:30 EST 2012


Author: borges
Date: 2012-01-23 07:00:29 -0500 (Mon, 23 Jan 2012)
New Revision: 12042

Modified:
   trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java
Log:
Check mkdirs return value (fixing findbugs warning)

Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java	2012-01-23 12:00:14 UTC (rev 12041)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java	2012-01-23 12:00:29 UTC (rev 12042)
@@ -28,15 +28,22 @@
 import org.hornetq.utils.Base64;
 
 /**
- * Use this class to import the journal data from a listed file. You can use it as a main class or through its native method {@link ImportJournal#importJournal(String, String, String, int, int, String)}
- * 
- * If you use the main method, use it as  <JournalDirectory> <JournalPrefix> <FileExtension> <MinFiles> <FileSize> <FileOutput>
- * 
- * Example: java -cp hornetq-core.jar org.hornetq.core.journal.impl.ExportJournal /journalDir hornetq-data hq 2 10485760 /tmp/export.dat
+ * Use this class to import the journal data from a listed file. You can use it as a main class or
+ * through its native method
+ * {@link ImportJournal#importJournal(String, String, String, int, int, String)}
+ * <p>
+ * If you use the main method, use its arguments as:
  *
+ * <pre>
+ * JournalDirectory JournalPrefix FileExtension MinFiles FileSize FileOutput
+ * </pre>
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * java -cp hornetq-core.jar org.hornetq.core.journal.impl.ExportJournal /journalDir hornetq-data hq 2 10485760 /tmp/export.dat
+ * </pre>
  * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
- *
- *
  */
 public class ImportJournal
 {
@@ -103,7 +110,11 @@
 
       File journalDir = new File(directory);
 
-      journalDir.mkdirs();
+      if (!journalDir.exists())
+      {
+         if (!journalDir.mkdirs())
+            System.err.println("Could not create directory " + directory);
+      }
 
       NIOSequentialFileFactory nio = new NIOSequentialFileFactory(directory, null);
 



More information about the hornetq-commits mailing list