@Override public void close() { if (lineBuffer.length() > 0) { flushLineBuffer(); } }
/** * Generate. * * @throws Exception * the exception */ public void generate() throws Exception { WsgenTool genTool = new WsgenTool(new WriterOutputStream(new LogWriter(log))); List<String> args = new ArrayList<String>(); configurImportToolOptions(args); mergeOriginalArgs(args); boolean success = genTool.run(args.toArray(new String[args.size()])); if (success) { log.info("Code generation completed"); } }
/** * Generate. * * @throws CodeGenerationException * the code generation exception */ public void generate() throws CodeGenerationException { WsimportTool importTool = new WsimportTool(new WriterOutputStream(new LogWriter(log))); ArrayList<String> args = new ArrayList<String>(); configurImportToolOptions(args); mergeOriginalArgs(args); boolean success = importTool.run(args.toArray(new String[args.size()])); if (success) { log.info("Code generation completed"); } }
public static void setupLogging(Session session, Log log, ParameterInclude params) throws AxisFault { // Note that debugging might already be enabled by the mail.debug property and we should // take care to override it. if (log.isTraceEnabled()) { // This is the old behavior: just set debug to true session.setDebug(true); } if (ParamUtils.getOptionalParamBoolean(params, MailConstants.TRANSPORT_MAIL_DEBUG, false)) { // Redirect debug output to where it belongs, namely to the logs! session.setDebugOut(new PrintStream(new WriterOutputStream(new LogWriter(log)), true)); // Only enable debug afterwards since the call to setDebug might already cause debug output session.setDebug(true); } } }
@Override public void write(char[] cbuf, int off, int len) { int start = off; for (int i=off; i<off+len; i++) { if (cbuf[i] == endOfLine.charAt(endOfLineMatch)) { endOfLineMatch++; if (endOfLineMatch == endOfLine.length()) { lineBuffer.append(cbuf, start, i-start+1); lineBuffer.setLength(lineBuffer.length()-endOfLine.length()); flushLineBuffer(); start = i+1; endOfLineMatch = 0; } } else { endOfLineMatch = 0; } } lineBuffer.append(cbuf, start, off+len-start); }