question: void printCommandBuilder ( CommandBuilder commandBuilder ) { if ( displayEquivalentArgument . isPresent ( ) ) { println ( ) ; printlnNoWrap ( INFO_DSCFG_NON_INTERACTIVE . get ( commandBuilder ) ) ; } if ( equivalentCommandFileArgument . isPresent ( ) ) { String file = equivalentCommandFileArgument . getValue ( ) ; BufferedWriter writer = null ; try { writer = new BufferedWriter ( new FileWriter ( file , true ) ) ; if ( ! sessionStartTimePrinted ) { writer . write ( SHELL_COMMENT_SEPARATOR + getSessionStartTimeMessage ( ) ) ; writer . newLine ( ) ; sessionStartTimePrinted = true ; } sessionEquivalentOperationNumber ++ ; writer . newLine ( ) ; writer . write ( SHELL_COMMENT_SEPARATOR + INFO_DSCFG_EQUIVALENT_COMMAND_LINE_SESSION_OPERATION_NUMBER . get ( sessionEquivalentOperationNumber ) ) ; writer . newLine ( ) ; writer . write ( SHELL_COMMENT_SEPARATOR + getCurrentOperationDateMessage ( ) ) ; writer . newLine ( ) ; writer . write ( commandBuilder . toString ( ) ) ; writer . newLine ( ) ; writer . newLine ( ) ; writer . flush ( ) ; } catch ( IOException ioe ) { errPrintln ( ERR_DSCFG_ERROR_WRITING_EQUIVALENT_COMMAND_LINE . get ( file , ioe ) ) ; } finally { closeSilently ( writer ) ; } } }
target:  Prints the contents of a command builder. This method has been created since SetPropSubCommandHandler calls it. All the logic of DSConfig is on this method. It writes the content of the CommandBuilder to the standard output, or to a file depending on the options provided by the user.