Ignore:
Timestamp:
03/08/12 09:21:51 (13 years ago)
Author:
sherbold
Message:
  • JFC pre-processors (commands preprocessDirJFC, preprocessJFC) now generate UTF-8 XML files instead of UTF-16.
  • de.ugoe.cs.eventbench.jfc.JFCLogParser adapted to read UTF-8 XML files instead of UTF-16.
  • parseDirJFC and parseJFC commands now both pre-compute all JFC event target equalities and furthermore compare all loaded events to a dummy event before the precomputation to make sure the events are known by de.ugoe.cs.eventbench.jfc.data.JFCTargetComparator.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/commands/CMDpreprocessDirJFC.java

    r384 r392  
    1717/** 
    1818 * <p> 
    19  * Command to pre-process files written by EventBench's JFCMonitor located in a directory. The only task 
    20  * of the pre-processing is checking if the session was closed properly, i.e., 
    21  * if the XML file ends with a {@code </sessions>} tag. If this is not the case, 
    22  * the tag will be appended to the file. 
     19 * Command to pre-process files written by EventBench's JFCMonitor located in a 
     20 * directory. The only task of the pre-processing is checking if the session was 
     21 * closed properly, i.e., if the XML file ends with a {@code </sessions>} tag. 
     22 * If this is not the case, the tag will be appended to the file. 
    2323 * </p> 
    2424 *  
     
    5050                String absolutPathSource = sourceFolder.getAbsolutePath(); 
    5151                File targetFolder = new File(targetPath); 
    52                 if( !targetFolder.isDirectory()) { 
     52                if (!targetFolder.isDirectory()) { 
    5353                        Console.printerrln(targetPath + " is not a directory"); 
    5454                } 
    5555                String absolutPathTarget = targetFolder.getAbsolutePath(); 
    56                  
    57                 for(String filename : sourceFolder.list()) { 
     56 
     57                for (String filename : sourceFolder.list()) { 
    5858                        String source = absolutPathSource + "/" + filename; 
    5959                        Console.traceln("Preprocessing file: " + source); 
     
    7878                                return; 
    7979                        } 
    80          
     80 
    8181                        String content = new String(buffer).trim(); 
    82          
     82 
    8383                        int index = filename.lastIndexOf('.'); 
    84                         String target = absolutPathTarget + "/" + filename.substring(0, index) + ".xml";  
    85                          
     84                        String target = absolutPathTarget + "/" 
     85                                        + filename.substring(0, index) + ".xml"; 
     86 
    8687                        Console.traceln("   Saving as: " + target); 
    87                          
     88 
    8889                        OutputStreamWriter writer; 
    8990                        try { 
    9091                                FileOutputStream fos = new FileOutputStream(target); 
    91                                 writer = new OutputStreamWriter(fos, "UTF-16"); 
     92                                writer = new OutputStreamWriter(fos, "UTF-8"); 
    9293                        } catch (IOException e) { 
    9394                                Console.printerrln(e.getMessage()); 
Note: See TracChangeset for help on using the changeset viewer.