crashanalysis/crashanalyser/com.nokia.s60tools.crashanalyser/src/com/nokia/s60tools/crashanalyser/files/CrashAnalyserFile.java
changeset 4 615035072f7e
parent 0 5ad7ad99af01
equal deleted inserted replaced
3:431bbaccaec8 4:615035072f7e
    17 
    17 
    18 package com.nokia.s60tools.crashanalyser.files;
    18 package com.nokia.s60tools.crashanalyser.files;
    19 
    19 
    20 import java.io.File;
    20 import java.io.File;
    21 import java.util.Date;
    21 import java.util.Date;
       
    22 import java.util.List;
       
    23 
    22 import org.xml.sax.helpers.DefaultHandler;
    24 import org.xml.sax.helpers.DefaultHandler;
    23 import com.nokia.s60tools.crashanalyser.data.*;
    25 import com.nokia.s60tools.crashanalyser.data.*;
       
    26 import com.nokia.s60tools.crashanalyser.containers.Thread;
    24 import java.text.DateFormat;
    27 import java.text.DateFormat;
    25 
    28 
    26 /**
    29 /**
    27  * This is a base class for all Crash Analyser file types. 
    30  * This is a base class for all Crash Analyser file types. 
    28  *
    31  *
    29  */
    32  */
    30 public abstract class CrashAnalyserFile extends DefaultHandler{
    33 public abstract class CrashAnalyserFile extends DefaultHandler {
    31 
    34 
    32 	// File extensions
    35 	// File extensions
    33 	public static final String OUTPUT_FILE_EXTENSION = "crashxml";
    36 	public static final String OUTPUT_FILE_EXTENSION = "crashxml";
    34 	public static final String MOBILECRASH_FILE_EXTENSION = "bin";
    37 	public static final String MOBILECRASH_FILE_EXTENSION = "bin";
    35 	public static final String D_EXC_FILE_EXTENSION = "txt";
    38 	public static final String D_EXC_FILE_EXTENSION = "txt";
    47 	protected String created = "";
    50 	protected String created = "";
    48 	protected String description = "";
    51 	protected String description = "";
    49 	protected String shortDescription = "";
    52 	protected String shortDescription = "";
    50 	protected String romId = "";
    53 	protected String romId = "";
    51 	protected String panicCode = "";
    54 	protected String panicCode = "";
    52 	
    55 	protected int totalThreadCount = -1;
       
    56 	protected int processCount = -1;
       
    57 
    53 	protected ErrorLibrary errorLibrary;
    58 	protected ErrorLibrary errorLibrary;
       
    59 
       
    60 	// Thread if this is for thread information only.
       
    61 	protected Thread threadInfo = null;
    54 
    62 
    55 	/**
    63 	/**
    56 	 * Constructor
    64 	 * Constructor
    57 	 * @param crashFilePath crash file path
    65 	 * @param crashFilePath crash file path
    58 	 * @param library error library
    66 	 * @param library error library
    70 	
    78 	
    71 	public String getThreadName() {
    79 	public String getThreadName() {
    72 		return threadName;
    80 		return threadName;
    73 	}
    81 	}
    74 	
    82 	
       
    83 	public int getTotalThreadCount() {
       
    84 		return totalThreadCount;
       
    85 	}
       
    86 	
       
    87 	public abstract List<Thread> getThreads();
       
    88 	
       
    89 	public int getProcessCount() {
       
    90 		return processCount;
       
    91 	}
       
    92 
    75 	public String getPanicCategory() {
    93 	public String getPanicCategory() {
    76 		return panicCategory;
    94 		return panicCategory;
    77 	}
    95 	}
    78 	
    96 	
    79 	public String getFileName() {
    97 	public String getFileName() {
   102 	
   120 	
   103 	public String getFilePath() {
   121 	public String getFilePath() {
   104 		return filePath; 
   122 		return filePath; 
   105 	}
   123 	}
   106 	
   124 	
       
   125 	public ErrorLibrary getErrorLibrary() {
       
   126 		return errorLibrary;
       
   127 	}
       
   128 	
       
   129 	public Thread getThread() {
       
   130 		return threadInfo;
       
   131 	}
       
   132 
   107 	/**
   133 	/**
   108 	 * Read file name and last modified time
   134 	 * Read file name and last modified time
   109 	 */
   135 	 */
   110 	protected void doRead() {
   136 	protected void doRead() {
   111 		File f = new File(filePath);
   137 		File f = new File(filePath);