Changeset 1822 for trunk/autoquest-htmlmonitor/src/main/java/de
- Timestamp:
- 11/13/14 15:24:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java
r1746 r1822 15 15 package de.ugoe.cs.autoquest.htmlmonitor; 16 16 17 import java.io.BufferedReader; 17 18 import java.io.File; 18 19 import java.io.FileOutputStream; 19 20 import java.io.IOException; 21 import java.io.InputStream; 22 import java.io.InputStreamReader; 20 23 import java.io.OutputStreamWriter; 21 24 import java.io.PrintWriter; … … 458 461 outputWriter.print("\" userAgent=\""); 459 462 outputWriter.print(StringTools.xmlEntityReplacement(this.userAgent)); 463 outputWriter.print("\" monitorInfos=\""); 464 outputWriter.print(StringTools.xmlEntityReplacement(getMonitorVersion())); 465 460 466 outputWriter.println("\">"); 461 467 462 468 loggedGUIElements.clear(); 469 } 470 471 /** 472 * <p> 473 * parses the POM properties if accessible and returns them. If they are not available, 474 * unknown is returned. 475 * </p> 476 */ 477 private String getMonitorVersion() { 478 InputStream properties = this.getClass().getClassLoader().getResourceAsStream 479 ("META-INF/maven/de.ugoe.cs.autoquest/autoquest-htmlmonitor/pom.properties"); 480 481 if (properties != null) { 482 try { 483 StringBuffer result = new StringBuffer(); 484 BufferedReader reader = new BufferedReader(new InputStreamReader(properties)); 485 486 String line = null; 487 488 do { 489 line = reader.readLine(); 490 491 if (line != null) { 492 if (result.length() > 0) { 493 result.append(" "); 494 } 495 496 result.append(line); 497 } 498 } 499 while (line != null); 500 501 reader.close(); 502 return result.toString(); 503 } 504 catch (IOException e) { 505 return "unknown"; 506 } 507 } 508 else { 509 return "unknown"; 510 } 463 511 } 464 512
Note: See TracChangeset
for help on using the changeset viewer.