crashanalysis/crashanalyser/com.nokia.s60tools.crashanalyser/src/com/nokia/s60tools/crashanalyser/files/CrashFile.java
changeset 4 615035072f7e
parent 0 5ad7ad99af01
equal deleted inserted replaced
3:431bbaccaec8 4:615035072f7e
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 package com.nokia.s60tools.crashanalyser.files;
    18 package com.nokia.s60tools.crashanalyser.files;
    19 
    19 
       
    20 import com.nokia.s60tools.crashanalyser.containers.Thread;
    20 import com.nokia.s60tools.crashanalyser.data.*;
    21 import com.nokia.s60tools.crashanalyser.data.*;
    21 import java.io.*;
    22 import java.io.*;
    22 import org.eclipse.jface.resource.ImageDescriptor;
    23 import org.eclipse.jface.resource.ImageDescriptor;
    23 import org.eclipse.ui.IEditorInput;
    24 import org.eclipse.ui.IEditorInput;
    24 
    25 
    38 	 */
    39 	 */
    39 	protected CrashFile(String filePath, ErrorLibrary library) {
    40 	protected CrashFile(String filePath, ErrorLibrary library) {
    40 		super(filePath, library);
    41 		super(filePath, library);
    41 	}
    42 	}
    42 	
    43 	
       
    44 	/**
       
    45 	 * Constructor
       
    46 	 * @param filePath file path to this crash file
       
    47 	 * @param library error library
       
    48 	 */
       
    49 	protected CrashFile(String filePath, ErrorLibrary library, Thread thread) {
       
    50 		super(filePath, library, thread);
       
    51 	}
       
    52 
    43 	/**
    53 	/**
    44 	 * Returns the file type of this crash file.
    54 	 * Returns the file type of this crash file.
    45 	 * @return "Decoded File"
    55 	 * @return "Decoded File"
    46 	 */
    56 	 */
    47 	public String getFileType() {
    57 	public String getFileType() {
    77 		
    87 		
    78 		CrashFile file = new CrashFile(crashFile, library);
    88 		CrashFile file = new CrashFile(crashFile, library);
    79 		file.doRead();
    89 		file.doRead();
    80 		return file;
    90 		return file;
    81 	}
    91 	}
    82 	
    92 
       
    93 	/**
       
    94 	 * Reads crash file
       
    95 	 * @param folder folder which contains one .crashxml file which will be read
       
    96 	 * @param library error library
       
    97 	 * @return read crash file
       
    98 	 */
       
    99 	public static CrashFile read(String folder, ErrorLibrary library, Thread thread) {
       
   100 		String crashFile = findFile(folder, CrashAnalyserFile.OUTPUT_FILE_EXTENSION);
       
   101 		
       
   102 		if (crashFile == null)
       
   103 			return null;
       
   104 		
       
   105 		CrashFile file = new CrashFile(crashFile, library, thread);
       
   106 		file.doRead();
       
   107 		return file;
       
   108 	}
       
   109 		
    83 	@Override
   110 	@Override
    84 	public ImageDescriptor getImageDescriptor() {
   111 	public ImageDescriptor getImageDescriptor() {
    85 		return null;
   112 		return null;
    86 	}
   113 	}
    87 
   114