convenience method since this pattern is used many times throughout Hudson

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9887 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-06-06 03:38:34 +00:00
1 parent a7a4104fe3
commit 721ca12762
1 file changed
+13
+13
View File
@@ -26,6 +26,8 @@ import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.PrintStream;
import java.io.StringWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.net.URI;
@@ -786,6 +788,17 @@ public class Util {
}
}
/**
* Obtains the stack dump as a string.
*
* @since 1.222
*/
public static String toString(Throwable t) {
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
return sw.toString();
}
public static final SimpleDateFormat XS_DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
// Note: RFC822 dates must not be localized!