1 11 package org.eclipse.ui.internal.about; 12 13 import java.io.File ; 14 import java.io.FileInputStream ; 15 import java.io.IOException ; 16 import java.io.InputStreamReader ; 17 import java.io.PrintWriter ; 18 import java.io.Reader ; 19 20 import org.eclipse.core.runtime.Platform; 21 import org.eclipse.ui.about.ISystemSummarySection; 22 23 29 public class ConfigurationLogErrorLogSection implements ISystemSummarySection { 30 31 36 public void write(PrintWriter writer) { 37 File log = new File (Platform.getLogFileLocation().toOSString()); 38 if (log.exists()) { 39 Reader reader = null; 40 try { 41 reader = new InputStreamReader (new FileInputStream (log), 42 "UTF-8"); char[] chars = new char[8192]; 44 while (true) { 45 int read = reader.read(chars); 46 if (read <= 0) 47 break; 48 writer.write(chars, 0, read); 49 } 50 } catch (IOException e) { 51 writer.println("Error reading .log file"); } finally { 53 try { 54 reader.close(); 55 } catch (IOException e) { 56 } 58 } 59 } 60 } 61 } 62 | Popular Tags |