Changeset 1440 for trunk/autoquest-plugin-http/src/main/java
- Timestamp:
- 03/12/14 13:18:20 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/HTTPLogParser.java
r1417 r1440 17 17 import java.io.ByteArrayInputStream; 18 18 import java.io.File; 19 import java.io.FileInputStream; 20 import java.io.FileNotFoundException; 19 21 import java.io.InputStream; 20 22 import java.util.Collection; … … 101 103 } 102 104 105 try { 106 parseFile(new FileInputStream(file)); 107 } catch (FileNotFoundException e) { 108 Console.printerr("Error parsing file + " + file.getName()); 109 Console.logException(e); 110 return; 111 } 112 } 113 114 /** 115 * <p> 116 * Parses a log file written by the HTTPMonitor and creates a collection of event sequences. 117 * </p> 118 * 119 * @param stream 120 * file to be parsed 121 * 122 * @throws SAXException in the case, the file could not be parsed 123 */ 124 public void parseFile(InputStream stream) throws JAXBException { 125 if (stream == null) { 126 throw new IllegalArgumentException("stream must not be null"); 127 } 128 103 129 JAXBContext jc = JAXBContext.newInstance(Session.class.getPackage().getName()); 104 130 105 131 Unmarshaller unmarshaller = jc.createUnmarshaller(); 106 StreamSource source = new StreamSource( file);132 StreamSource source = new StreamSource(stream); 107 133 108 134 @SuppressWarnings("unchecked")
Note: See TracChangeset
for help on using the changeset viewer.