2015-06-01 19:35:51 +10:00
|
|
|
package com.bytezone.diskbrowser.applefile;
|
|
|
|
|
2020-09-14 17:59:15 +10:00
|
|
|
// -----------------------------------------------------------------------------------//
|
2015-06-01 19:35:51 +10:00
|
|
|
public class ErrorMessageFile extends AbstractFile
|
2020-09-14 17:59:15 +10:00
|
|
|
// -----------------------------------------------------------------------------------//
|
2015-06-01 19:35:51 +10:00
|
|
|
{
|
|
|
|
String text;
|
|
|
|
|
2020-09-14 17:59:15 +10:00
|
|
|
// ---------------------------------------------------------------------------------//
|
2015-06-01 19:35:51 +10:00
|
|
|
public ErrorMessageFile (String name, byte[] buffer, Exception e)
|
2020-09-14 17:59:15 +10:00
|
|
|
// ---------------------------------------------------------------------------------//
|
2015-06-01 19:35:51 +10:00
|
|
|
{
|
|
|
|
super (name, buffer);
|
|
|
|
|
|
|
|
StringBuilder text = new StringBuilder ();
|
|
|
|
text.append ("Oops! : " + e.toString () + "\n\n");
|
2020-09-14 17:59:15 +10:00
|
|
|
|
2015-06-01 19:35:51 +10:00
|
|
|
for (StackTraceElement ste : e.getStackTrace ())
|
|
|
|
text.append (ste + "\n");
|
2020-09-14 17:59:15 +10:00
|
|
|
|
2015-06-01 19:35:51 +10:00
|
|
|
if (text.length () > 0)
|
|
|
|
text.deleteCharAt (text.length () - 1);
|
2020-09-14 17:59:15 +10:00
|
|
|
|
2015-06-01 19:35:51 +10:00
|
|
|
this.text = text.toString ();
|
|
|
|
}
|
|
|
|
|
2020-09-14 17:59:15 +10:00
|
|
|
// ---------------------------------------------------------------------------------//
|
2015-06-01 19:35:51 +10:00
|
|
|
@Override
|
|
|
|
public String getText ()
|
2020-09-14 17:59:15 +10:00
|
|
|
// ---------------------------------------------------------------------------------//
|
2015-06-01 19:35:51 +10:00
|
|
|
{
|
|
|
|
return text;
|
|
|
|
}
|
|
|
|
}
|