Java exec Execption2Strings(boolean rep, Throwable... execptions)

Here you can find the source of Execption2Strings(boolean rep, Throwable... execptions)

Description

Execption Strings

License

Apache License

Declaration

public static String Execption2Strings(boolean rep, Throwable... execptions) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.PrintWriter;
import java.io.StringWriter;

public class Main {
    public static String Execption2Strings(boolean rep, Throwable... execptions) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        for (Throwable e : execptions) {
            e.printStackTrace(pw);//from ww  w. ja  va 2s.co m
        }
        if (rep) {
            return sw.toString().replaceAll("\r\n|\n\r|\r|\n", "<br/>\n");
        }
        return sw.toString();
    }
}

Related

  1. exeCmdByOs(String cmd)
  2. execName()
  3. execPrint(final boolean out, final String... command)
  4. execProcess(String process)
  5. execProcess(String[] cmdline, final long timeout)
  6. execScript(File shellScriptFile, String[] scriptCommand, PrintWriter execLog)
  7. execShell(String cmd)
  8. execShell(String shell)
  9. execSudoCommand(final String _sudoCmd, final String _pw)