Changeset 1440


Ignore:
Timestamp:
03/12/14 13:18:20 (10 years ago)
Author:
sherbold
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/HTTPLogParser.java

    r1417 r1440  
    1717import java.io.ByteArrayInputStream; 
    1818import java.io.File; 
     19import java.io.FileInputStream; 
     20import java.io.FileNotFoundException; 
    1921import java.io.InputStream; 
    2022import java.util.Collection; 
     
    101103        } 
    102104         
     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         
    103129        JAXBContext jc = JAXBContext.newInstance(Session.class.getPackage().getName()); 
    104130         
    105131        Unmarshaller unmarshaller = jc.createUnmarshaller(); 
    106         StreamSource source = new StreamSource(file); 
     132        StreamSource source = new StreamSource(stream); 
    107133         
    108134        @SuppressWarnings("unchecked") 
Note: See TracChangeset for help on using the changeset viewer.