mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-01 09:50:32 +00:00
34 lines
1.1 KiB
Java
34 lines
1.1 KiB
Java
package com.bytezone.diskbrowser.applefile;
|
|
|
|
// -----------------------------------------------------------------------------------//
|
|
public class ErrorMessageFile extends AbstractFile
|
|
// -----------------------------------------------------------------------------------//
|
|
{
|
|
String text;
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
public ErrorMessageFile (String name, byte[] buffer, Exception e)
|
|
// ---------------------------------------------------------------------------------//
|
|
{
|
|
super (name, buffer);
|
|
|
|
StringBuilder text = new StringBuilder ();
|
|
text.append ("Oops! : " + e.toString () + "\n\n");
|
|
|
|
for (StackTraceElement ste : e.getStackTrace ())
|
|
text.append (ste + "\n");
|
|
|
|
if (text.length () > 0)
|
|
text.deleteCharAt (text.length () - 1);
|
|
|
|
this.text = text.toString ();
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
@Override
|
|
public String getText ()
|
|
// ---------------------------------------------------------------------------------//
|
|
{
|
|
return text;
|
|
}
|
|
} |