From eafca206111b23cd7f5ceea1a5e48c395d3f5a79 Mon Sep 17 00:00:00 2001 From: giberta1 Date: Thu, 2 May 2002 17:09:35 +0000 Subject: [PATCH] Add Keep Message Break support, Add -kmb option. --- MQSLoad.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/MQSLoad.java b/MQSLoad.java index c32f720..4c34772 100644 --- a/MQSLoad.java +++ b/MQSLoad.java @@ -1,7 +1,7 @@ // $RCSfile: MQSLoad.java,v $ -// $Revision: 1.4 $ +// $Revision: 1.5 $ // $Name: $ -// $Date: 2002/04/23 15:07:47 $ +// $Date: 2002/05/02 17:09:35 $ // $Author: giberta1 $ /* @@ -43,6 +43,7 @@ public class MQSLoad private String File_Name; private String Field_Break = ""; private String Message_Break = "\r\n"; + private boolean Keep_Message_Break = false; @@ -221,6 +222,10 @@ public class MQSLoad throw new Exception(); } } + else if ( args[argc].equals( "-kmb")) + { + Keep_Message_Break = true; + } else { MsgQ_Name = args[argc++]; @@ -439,6 +444,11 @@ public class MQSLoad if( next_message <= cur_window_size) { // System.out.println( "* Write Msg CurPos: (" + cur_pos + ")"); + if( Keep_Message_Break) + { + output_msg.writeString( Message_Break); + } + output_msg.messageId = MQC.MQMI_NONE; MQSPut_Msg( output_msg); output_msg.clearMessage(); @@ -498,8 +508,8 @@ public class MQSLoad if( ( args.length < 2) || ( args.length > 6)) { - System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] "); - System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ")"); + System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] [-kmb] "); + System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Keep Message Break: (" + Keep_Message_Break + ")"); } else { @@ -508,7 +518,7 @@ public class MQSLoad Arg_Parse( args); System.out.println( "Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")"); - System.out.println( "Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ")"); + System.out.println( "Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Keep Message Break: (" + Keep_Message_Break + ")"); MQSInit();