Author: jicken
Date: 2011-06-02 17:17:28 -0400 (Thu, 02 Jun 2011)
New Revision: 10767
Modified:
branches/Branch_2_2_EAP_export_tool/.gitignore
branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ExportData.java
Log:
added an optional filename argument for exporting
Modified: branches/Branch_2_2_EAP_export_tool/.gitignore
===================================================================
--- branches/Branch_2_2_EAP_export_tool/.gitignore 2011-06-02 16:33:20 UTC (rev 10766)
+++ branches/Branch_2_2_EAP_export_tool/.gitignore 2011-06-02 21:17:28 UTC (rev 10767)
@@ -1,3 +1,5 @@
+.idea
+classes
target
thirdparty
native
Modified:
branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ExportData.java
===================================================================
---
branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ExportData.java 2011-06-02
16:33:20 UTC (rev 10766)
+++
branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ExportData.java 2011-06-02
21:17:28 UTC (rev 10767)
@@ -13,33 +13,44 @@
package org.hornetq.core.persistence.tools;
+import org.hornetq.core.journal.impl.SyncSpeedTest;
+
+import java.io.*;
+
/**
* A ExportData
*
* @author clebertsuconic
- *
- *
+ * @author <a href="mailto:torben@jit-consulting.de">Torben
Jaeger</a>
*/
-public class ExportData
-{
+public class ExportData {
- public static void main(String args[])
- {
- if (args.length != 2) {
+ public static void main(String args[]) {
+ if (args.length != 2 && args.length != 3) {
// todo: maybe just use a hq-config.xml file as a parameter
- System.out.println("Usage Export: java
org.hornetq.core.persistence.tools.ExportData <bindings-dir>
<journal-dir>");
+ System.out.println("Usage: java
org.hornetq.core.persistence.tools.ExportData <bindings-dir> " +
+ "<journal-dir> [filename]");
+ System.out.println("[filename] is optional. If no filename is given,
standard out is used!");
System.exit(-1);
}
- try
- {
- ManageDataTool.exportMessages(args[0], args[1], System.out);
+
+ PrintStream output = System.out;
+ if (args.length == 3) {
+ try {
+ output = new PrintStream(new FileOutputStream(args[2],true));
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
}
- catch (Exception e)
- {
+
+ try {
+ ManageDataTool.exportMessages(args[0], args[1], output);
+ } catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
-
+
}
// Constants -----------------------------------------------------
Show replies by date