]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
e4800816cb6264b9e8ab66d188addc5a4fc6c1c4
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / workspace / WorkspaceTools.java
1 /** @file
2
3 The file is used to init workspace and get basic information of workspace
4
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15 package org.tianocore.frameworkwizard.workspace;
16
17 import java.io.IOException;
18 import java.util.Vector;
19
20 import org.apache.xmlbeans.XmlException;
21 import org.tianocore.DbPathAndFilename;
22 import org.tianocore.FrameworkDatabaseDocument;
23 import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes;
24 import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
25 import org.tianocore.MsaFilesDocument.MsaFiles;
26 import org.tianocore.MsaHeaderDocument.MsaHeader;
27 import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
28 import org.tianocore.PlatformHeaderDocument.PlatformHeader;
29 import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
30 import org.tianocore.SourceFilesDocument.SourceFiles;
31 import org.tianocore.SpdHeaderDocument.SpdHeader;
32 import org.tianocore.frameworkwizard.common.DataType;
33 import org.tianocore.frameworkwizard.common.Log;
34 import org.tianocore.frameworkwizard.common.SaveFile;
35 import org.tianocore.frameworkwizard.common.Tools;
36 import org.tianocore.frameworkwizard.common.Identifications.Identification;
37 import org.tianocore.frameworkwizard.common.Identifications.OpenFile;
38 import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
39 import org.tianocore.frameworkwizard.packaging.PackageIdentification;
40 import org.tianocore.frameworkwizard.platform.PlatformIdentification;
41
42 public class WorkspaceTools {
43 //
44 // Define class members
45 //
46 private FrameworkDatabaseDocument.FrameworkDatabase fdb = null;
47
48 private Vector<ModuleIdentification> vModuleList = new Vector<ModuleIdentification>();
49
50 private Vector<PackageIdentification> vPackageList = new Vector<PackageIdentification>();
51
52 private Vector<PlatformIdentification> vPlatformList = new Vector<PlatformIdentification>();
53
54 /**
55
56 Open Framework Database file
57
58 */
59 private void openFrameworkDb() {
60 String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
61 strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
62 try {
63 fdb = OpenFile.openFrameworkDb(strFrameworkDbFilePath);
64 } catch (XmlException e) {
65 Log.err("Open Framework Database " + strFrameworkDbFilePath, e.getMessage());
66 return;
67 } catch (Exception e) {
68 Log.err("Open Framework Database " + strFrameworkDbFilePath, "Invalid file type");
69 return;
70 }
71 }
72
73 /**
74 Get all modules' paths from one package
75
76 @return a Vector with all modules' path
77
78 **/
79 public Vector<String> getAllModulesOfPackage(String path) {
80 Vector<String> modulePath = new Vector<String>();
81 try {
82 MsaFiles files = OpenFile.openSpdFile(path).getMsaFiles();
83 if (files != null) {
84 for (int index = 0; index < files.getFilenameList().size(); index++) {
85 String msaPath = files.getFilenameList().get(index);
86 msaPath = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + msaPath;
87 msaPath = Tools.convertPathToCurrentOsType(msaPath);
88 modulePath.addElement(msaPath);
89 }
90 }
91 } catch (IOException e) {
92
93 } catch (XmlException e) {
94
95 } catch (Exception e) {
96
97 }
98 return modulePath;
99 }
100
101 /**
102 Get all Industry Std Includes' paths from one package
103
104 @return a Vector with all paths
105
106 **/
107 public Vector<String> getAllIndustryStdIncludesOfPackage(String path) {
108 Vector<String> includePath = new Vector<String>();
109 try {
110 IndustryStdIncludes files = OpenFile.openSpdFile(path).getIndustryStdIncludes();
111 if (files != null) {
112 for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) {
113 String temp = files.getIndustryStdHeaderList().get(index).getName();
114 temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;
115 temp = Tools.convertPathToCurrentOsType(temp);
116 includePath.addElement(temp);
117 }
118 }
119 } catch (IOException e) {
120
121 } catch (XmlException e) {
122
123 } catch (Exception e) {
124
125 }
126 return includePath;
127 }
128
129 /**
130 Get all package basic information form the FrameworkDatabase.db file
131
132 @return vPackageList A vector includes all packages' basic information
133
134 */
135 public Vector<PackageIdentification> getAllPackages() {
136 Identification id = null;
137 vPackageList.removeAllElements();
138
139 openFrameworkDb();
140
141 for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {
142 String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
143 + fdb.getPackageList().getFilenameArray(index).getStringValue();
144 path = Tools.convertPathToCurrentOsType(path);
145 try {
146 id = getId(path, OpenFile.openSpdFile(path));
147 vPackageList.addElement(new PackageIdentification(id));
148 } catch (IOException e) {
149 Log.err("Open Package Surface Area " + path, e.getMessage());
150
151 } catch (XmlException e) {
152 Log.err("Open Package Surface Area " + path, e.getMessage());
153
154 } catch (Exception e) {
155 Log.err("Open Package Surface Area " + path, "Invalid file type");
156
157 }
158 }
159 Tools.sortPackages(vPackageList, DataType.SORT_TYPE_ASCENDING);
160 return vPackageList;
161 }
162
163 /**
164 Get all module basic information from a package
165
166 @param id Package id
167 @return A vector includes all modules' basic information
168
169 **/
170 public Vector<ModuleIdentification> getAllModules(PackageIdentification pid) {
171 Vector<ModuleIdentification> v = new Vector<ModuleIdentification>();
172 Vector<String> modulePaths = this.getAllModulesOfPackage(pid.getPath());
173 Identification id = null;
174 String modulePath = null;
175
176 for (int index = 0; index < modulePaths.size(); index++) {
177 try {
178 modulePath = modulePaths.get(index);
179 id = getId(modulePath, OpenFile.openMsaFile(modulePath));
180 } catch (IOException e) {
181 Log.log("Error when Open Module Surface Area " + modulePath, e.getMessage());
182 } catch (XmlException e) {
183 Log.log("Error when Open Module Surface Area " + modulePath, e.getMessage());
184 } catch (Exception e) {
185 Log.log("Error when Open Module Surface Area " + modulePath, "Invalid file type " + e.getMessage());
186 }
187 v.addElement(new ModuleIdentification(id, pid));
188 }
189 Tools.sortModules(v, DataType.SORT_TYPE_ASCENDING);
190 return v;
191
192 }
193
194 /**
195 Get all module basic information form the FrameworkDatabase.db file
196
197 @return vModuleList A vector includes all modules' basic information
198
199 */
200 public Vector<ModuleIdentification> getAllModules() {
201 vModuleList.removeAllElements();
202 //
203 // First get all packages
204 //
205 getAllPackages();
206 Vector<String> modulePaths = new Vector<String>();
207 Identification id = null;
208 String packagePath = null;
209 String modulePath = null;
210
211 //
212 // For each package, get all modules list
213 //
214 for (int indexI = 0; indexI < vPackageList.size(); indexI++) {
215 packagePath = vPackageList.elementAt(indexI).getPath();
216 modulePaths = this.getAllModulesOfPackage(packagePath);
217
218 for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {
219 try {
220 modulePath = modulePaths.get(indexJ);
221 id = getId(modulePath, OpenFile.openMsaFile(modulePath));
222 vModuleList.addElement(new ModuleIdentification(id, vPackageList.elementAt(indexI)));
223 } catch (IOException e) {
224 Log.err("Open Module Surface Area " + modulePath, e.getMessage());
225 } catch (XmlException e) {
226 Log.err("Open Module Surface Area " + modulePath, e.getMessage());
227 } catch (Exception e) {
228 Log.err("Open Module Surface Area " + modulePath, "Invalid file type");
229 }
230 }
231 }
232 Tools.sortModules(vModuleList, DataType.SORT_TYPE_ASCENDING);
233 return vModuleList;
234 }
235
236 /**
237 Get all platform basic information form the FrameworkDatabase.db file
238
239 @return vplatformList A vector includes all platforms' basic information
240
241 */
242 public Vector<PlatformIdentification> getAllPlatforms() {
243 Identification id = null;
244 vPlatformList.removeAllElements();
245
246 openFrameworkDb();
247
248 for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {
249 String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
250 + fdb.getPlatformList().getFilenameArray(index).getStringValue();
251 path = Tools.convertPathToCurrentOsType(path);
252 try {
253 id = getId(path, OpenFile.openFpdFile(path));
254 vPlatformList.addElement(new PlatformIdentification(id));
255 } catch (IOException e) {
256 Log.err("Open Platform Surface Area " + path, e.getMessage());
257 } catch (XmlException e) {
258 Log.err("Open Platform Surface Area " + path, e.getMessage());
259 } catch (Exception e) {
260 Log.err("Open Platform Surface Area " + path, "Invalid file type");
261 }
262 }
263 Tools.sortPlatforms(vPlatformList, DataType.SORT_TYPE_ASCENDING);
264 return vPlatformList;
265 }
266
267 /**
268 Get all Library Class Definitions from a package
269
270 @return Vector
271 **/
272 public Vector<String> getAllLibraryClassDefinitionsFromPackage(PackageSurfaceArea spd) {
273 Vector<String> vector = new Vector<String>();
274 if (spd.getLibraryClassDeclarations() != null) {
275 if (spd.getLibraryClassDeclarations().getLibraryClassList().size() > 0) {
276 for (int index = 0; index < spd.getLibraryClassDeclarations().getLibraryClassList().size(); index++) {
277 vector.addElement(spd.getLibraryClassDeclarations().getLibraryClassList().get(index).getName());
278 }
279 }
280 }
281 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
282 return vector;
283 }
284
285 /**
286 Get all Protocol Definitions from a package
287
288 @return Vector
289 **/
290 public Vector<String> getAllProtocolDeclarationsFromPackage(PackageSurfaceArea spd) {
291 Vector<String> vector = new Vector<String>();
292 if (spd.getProtocolDeclarations() != null) {
293 if (spd.getProtocolDeclarations().getEntryList().size() > 0) {
294 for (int index = 0; index < spd.getProtocolDeclarations().getEntryList().size(); index++) {
295 vector.addElement(spd.getProtocolDeclarations().getEntryList().get(index).getCName());
296 }
297 }
298 }
299 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
300 return vector;
301 }
302
303 /**
304 Get all Ppi Definitions from a package
305
306 @return Vector
307 **/
308 public Vector<String> getAllPpiDeclarationsFromPackage(PackageSurfaceArea spd) {
309 Vector<String> vector = new Vector<String>();
310 if (spd.getPpiDeclarations() != null) {
311 if (spd.getPpiDeclarations().getEntryList().size() > 0) {
312 for (int index = 0; index < spd.getPpiDeclarations().getEntryList().size(); index++) {
313 vector.addElement(spd.getPpiDeclarations().getEntryList().get(index).getCName());
314 }
315 }
316 }
317 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
318 return vector;
319 }
320
321 /**
322 Get all Guid Definitions from a package
323
324 @return Vector
325 **/
326 public Vector<String> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd) {
327 Vector<String> vector = new Vector<String>();
328 if (spd.getGuidDeclarations() != null) {
329 if (spd.getGuidDeclarations().getEntryList().size() > 0) {
330 for (int index = 0; index < spd.getGuidDeclarations().getEntryList().size(); index++) {
331 vector.addElement(spd.getGuidDeclarations().getEntryList().get(index).getCName());
332 }
333 }
334 }
335 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
336 return vector;
337 }
338
339 /**
340 Get all Pcd Definitions from a package
341
342 @return Vector
343 **/
344 public Vector<String> getAllPcdDeclarationsFromPackage(PackageSurfaceArea spd) {
345 Vector<String> vector = new Vector<String>();
346 if (spd.getPcdDeclarations() != null) {
347 if (spd.getPcdDeclarations().getPcdEntryList().size() > 0) {
348 for (int index = 0; index < spd.getPcdDeclarations().getPcdEntryList().size(); index++) {
349 vector.addElement(spd.getPcdDeclarations().getPcdEntryList().get(index).getCName());
350 }
351 }
352 }
353 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
354 return vector;
355 }
356
357 public Vector<String> getAllLibraryClassDefinitionsFromWorkspace() {
358 //
359 // First get all packages
360 //
361 this.getAllPackages();
362
363 Vector<String> vector = new Vector<String>();
364 for (int index = 0; index < this.vPackageList.size(); index++) {
365 try {
366 Vector<String> v = getAllLibraryClassDefinitionsFromPackage(OpenFile
367 .openSpdFile(vPackageList
368 .get(index)
369 .getPath()));
370 if (v != null && v.size() > 0) {
371 vector.addAll(v);
372 }
373 } catch (IOException e) {
374 // TODO Auto-generated catch block
375 } catch (XmlException e) {
376 // TODO Auto-generated catch block
377 } catch (Exception e) {
378 // TODO Auto-generated catch block
379 }
380 }
381 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
382 return vector;
383 }
384
385 public Vector<String> getAllProtocolDeclarationsFromWorkspace() {
386 //
387 // First get all packages
388 //
389 this.getAllPackages();
390
391 Vector<String> vector = new Vector<String>();
392 for (int index = 0; index < this.vPackageList.size(); index++) {
393 try {
394 Vector<String> v = getAllProtocolDeclarationsFromPackage(OpenFile.openSpdFile(vPackageList.get(index)
395 .getPath()));
396 if (v != null && v.size() > 0) {
397 vector.addAll(v);
398 }
399 } catch (IOException e) {
400 // TODO Auto-generated catch block
401 } catch (XmlException e) {
402 // TODO Auto-generated catch block
403 } catch (Exception e) {
404 // TODO Auto-generated catch block
405 }
406 }
407 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
408 return vector;
409 }
410
411 public Vector<String> getAllPpiDeclarationsFromWorkspace() {
412 //
413 // First get all packages
414 //
415 this.getAllPackages();
416
417 Vector<String> vector = new Vector<String>();
418 for (int index = 0; index < this.vPackageList.size(); index++) {
419 try {
420 Vector<String> v = getAllPpiDeclarationsFromPackage(OpenFile.openSpdFile(vPackageList.get(index)
421 .getPath()));
422 if (v != null && v.size() > 0) {
423 vector.addAll(v);
424 }
425 } catch (IOException e) {
426 // TODO Auto-generated catch block
427 } catch (XmlException e) {
428 // TODO Auto-generated catch block
429 } catch (Exception e) {
430 // TODO Auto-generated catch block
431 }
432 }
433 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
434 return vector;
435 }
436
437 public Vector<String> getAllGuidDeclarationsFromWorkspace() {
438 //
439 // First get all packages
440 //
441 this.getAllPackages();
442
443 Vector<String> vector = new Vector<String>();
444 for (int index = 0; index < this.vPackageList.size(); index++) {
445 try {
446 Vector<String> v = getAllGuidDeclarationsFromPackage(OpenFile.openSpdFile(vPackageList.get(index)
447 .getPath()));
448 if (v != null && v.size() > 0) {
449 vector.addAll(v);
450 }
451 } catch (IOException e) {
452 // TODO Auto-generated catch block
453 } catch (XmlException e) {
454 // TODO Auto-generated catch block
455 } catch (Exception e) {
456 // TODO Auto-generated catch block
457 }
458 }
459 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
460 return vector;
461 }
462
463 public Vector<String> getAllPcdDeclarationsFromWorkspace() {
464 //
465 // First get all packages
466 //
467 this.getAllPackages();
468
469 Vector<String> vector = new Vector<String>();
470 for (int index = 0; index < this.vPackageList.size(); index++) {
471 try {
472 Vector<String> v = getAllPcdDeclarationsFromPackage(OpenFile.openSpdFile(vPackageList.get(index)
473 .getPath()));
474 if (v != null && v.size() > 0) {
475 vector.addAll(v);
476 }
477 } catch (IOException e) {
478 // TODO Auto-generated catch block
479 } catch (XmlException e) {
480 // TODO Auto-generated catch block
481 } catch (Exception e) {
482 // TODO Auto-generated catch block
483 }
484 }
485 Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
486 return vector;
487 }
488
489 /**
490 Find a module's package's id
491
492 @param id input module id
493 @return package id
494
495 **/
496 public PackageIdentification getPackageIdByModuleId(Identification id) {
497 getAllPackages();
498 Vector<String> modulePaths = new Vector<String>();
499 Identification mid = null;
500 String packagePath = null;
501 String modulePath = null;
502
503 //
504 // For each package, get all modules list
505 //
506 for (int indexI = 0; indexI < vPackageList.size(); indexI++) {
507 packagePath = vPackageList.elementAt(indexI).getPath();
508 modulePaths = this.getAllModulesOfPackage(packagePath);
509 for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {
510 modulePath = modulePaths.get(indexJ);
511 try {
512 mid = getId(modulePath, OpenFile.openMsaFile(modulePath));
513 //
514 // Check id
515 //
516 if (mid.equals(id)) {
517 return vPackageList.elementAt(indexI);
518 }
519 } catch (IOException e) {
520
521 } catch (XmlException e) {
522
523 } catch (Exception e) {
524
525 }
526 }
527 }
528
529 return null;
530 }
531
532 public Identification getId(String path, ModuleSurfaceArea msa) {
533 MsaHeader head = msa.getMsaHeader();
534 String name = head.getModuleName();
535 String guid = head.getGuidValue();
536 String version = head.getVersion();
537 Identification id = new Identification(name, guid, version, path);
538 return id;
539 }
540
541 public Identification getId(String path, PackageSurfaceArea spd) {
542 SpdHeader head = spd.getSpdHeader();
543 String name = head.getPackageName();
544 String guid = head.getGuidValue();
545 String version = head.getVersion();
546 Identification id = new Identification(name, guid, version, path);
547 return id;
548 }
549
550 public Identification getId(String path, PlatformSurfaceArea fpd) {
551 PlatformHeader head = fpd.getPlatformHeader();
552 String name = head.getPlatformName();
553 String guid = head.getGuidValue();
554 String version = head.getVersion();
555 Identification id = new Identification(name, guid, version, path);
556 return id;
557 }
558
559 /**
560 Add module information to package surface area
561
562 @param mid
563 @throws IOException
564 @throws XmlException
565 @throws Exception
566
567 **/
568 public void addModuleToPackage(ModuleIdentification mid, PackageSurfaceArea spd) throws IOException, XmlException,
569 Exception {
570 String packagePath = mid.getPackageId().getPath();
571 String modulePath = mid.getPath();
572 if (spd == null) {
573 spd = OpenFile.openSpdFile(packagePath);
574 }
575 MsaFiles msaFile = spd.getMsaFiles();
576 if (msaFile == null) {
577 msaFile = MsaFiles.Factory.newInstance();
578 }
579 packagePath = packagePath.substring(0, packagePath.lastIndexOf(DataType.FILE_SEPARATOR));
580 String fn = Tools.getRelativePath(modulePath, packagePath);
581 msaFile.addNewFilename();
582 msaFile.setFilenameArray(msaFile.getFilenameList().size() - 1, fn);
583 spd.setMsaFiles(msaFile);
584 SaveFile.saveSpdFile(mid.getPackageId().getPath(), spd);
585 }
586
587 /**
588 Add input package into database
589
590 @param id
591 * @throws Exception
592
593 **/
594 public void addPackageToDatabase(PackageIdentification id) throws Exception {
595 String path = id.getPath();
596 path = Tools.getRelativePath(path, Workspace.getCurrentWorkspace());
597 this.openFrameworkDb();
598 DbPathAndFilename filename = DbPathAndFilename.Factory.newInstance();
599 filename.setStringValue(path);
600 fdb.getPackageList().addNewFilename();
601 fdb.getPackageList().setFilenameArray(fdb.getPackageList().sizeOfFilenameArray() - 1, filename);
602 String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
603 strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
604 SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
605 }
606
607 /**
608 Add input package into database
609
610 @param id
611 * @throws Exception
612
613 **/
614 public void addPlatformToDatabase(PlatformIdentification id) throws Exception {
615 String path = id.getPath();
616 path = Tools.getRelativePath(path, Workspace.getCurrentWorkspace());
617 this.openFrameworkDb();
618 DbPathAndFilename filename = DbPathAndFilename.Factory.newInstance();
619 filename.setStringValue(path);
620 fdb.getPlatformList().addNewFilename();
621 fdb.getPlatformList().setFilenameArray(fdb.getPlatformList().sizeOfFilenameArray() - 1, filename);
622 String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
623 strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
624 SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
625 }
626
627 /**
628 Get all file's path from one module
629
630 @param path
631 @return
632 @throws IOException
633 @throws XmlException
634 @throws Exception
635
636 **/
637 public Vector<String> getAllModuleFilesPath(String path) throws IOException, XmlException, Exception {
638 Vector<String> v = new Vector<String>();
639 path = Tools.convertPathToCurrentOsType(path);
640 v.addElement(path);
641 ModuleSurfaceArea msa = OpenFile.openMsaFile(path);
642 if (msa != null) {
643 //
644 // Get all files' path of a module
645 //
646 SourceFiles sf = msa.getSourceFiles();
647 if (sf != null) {
648 for (int index = 0; index < sf.getFilenameList().size(); index++) {
649 String temp = sf.getFilenameList().get(index).getStringValue();
650 temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;
651 v.addElement(Tools.convertPathToCurrentOsType(temp));
652 }
653 }
654 }
655
656 return v;
657 }
658
659 /**
660 Get all file's path from one package
661
662 @param path
663 @return
664 @throws IOException
665 @throws XmlException
666 @throws Exception
667
668 **/
669 public Vector<String> getAllPakcageFilesPath(String path) throws IOException, XmlException, Exception {
670 Vector<String> v = new Vector<String>();
671 path = Tools.convertPathToCurrentOsType(path);
672 //
673 // First add package
674 //
675 v.addElement(path);
676
677 //
678 // Add the package's industry std includes one by one
679 //
680 Vector<String> f1 = new Vector<String>();
681 f1 = getAllIndustryStdIncludesOfPackage(path);
682 for (int index = 0; index < f1.size(); index++) {
683 v.addElement(f1.get(index));
684 }
685
686 //
687 // Add module's files one by one
688 //
689 f1 = new Vector<String>();
690 f1 = getAllModulesOfPackage(path);
691 for (int indexI = 0; indexI < f1.size(); indexI++) {
692 Vector<String> f2 = getAllModuleFilesPath(f1.get(indexI));
693 for (int indexJ = 0; indexJ < f2.size(); indexJ++) {
694 v.addElement(f2.get(indexJ));
695 }
696 }
697
698 return v;
699 }
700 }