|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 package com.nokia.s60tools.memspy.files; |
|
21 |
|
22 /** |
|
23 * class HeapDumpFile. |
|
24 * This class represents one Heap Dump. |
|
25 */ |
|
26 |
|
27 public class HeapDumpFile extends MemSpyFile { |
|
28 |
|
29 /* path of XML-file*/ |
|
30 private String xmlPath; |
|
31 |
|
32 /** |
|
33 * HeapDumpFile. |
|
34 * constructor |
|
35 * @param filePath files path |
|
36 * @param xmlPath xml files path |
|
37 */ |
|
38 public HeapDumpFile( String filePath, String xmlPath ) { |
|
39 super(filePath); |
|
40 this.xmlPath = xmlPath; |
|
41 } |
|
42 |
|
43 /** |
|
44 * Read's file variables from file that is defined in filePath |
|
45 * @param folder folder where files are searched |
|
46 * @return New HeapDumpFile |
|
47 */ |
|
48 static public HeapDumpFile read( String folder ){ |
|
49 |
|
50 String xmlPath = findFile(folder, "xml"); |
|
51 String heapPath = findFile(folder, "txt"); |
|
52 |
|
53 if ( xmlPath == null || heapPath == null ){ |
|
54 return null; |
|
55 } |
|
56 HeapDumpFile heapFile = new HeapDumpFile( heapPath, xmlPath ); |
|
57 heapFile.doRead(); |
|
58 heapFile.setFileType("Heap Dump"); |
|
59 return heapFile; |
|
60 } |
|
61 |
|
62 /** |
|
63 * Get XML file path |
|
64 * @return path of xml-file |
|
65 */ |
|
66 public String getXmlPath() { |
|
67 return xmlPath; |
|
68 } |
|
69 |
|
70 |
|
71 } |