Changeset 798


Ignore:
Timestamp:
05/13/11 18:57:44 (8 years ago)
Author:
philsmart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • raptor-parse/trunk/src/main/java/uk/ac/cardiff/raptor/parse/external/file/LogFileParser.java

    r779 r798  
    4444import org.slf4j.LoggerFactory; 
    4545 
     46import com.ibm.icu.text.SimpleDateFormat; 
     47 
    4648import uk.ac.cardiff.model.event.Event; 
    4749import uk.ac.cardiff.raptor.parse.BaseEventParser; 
     
    109111        @Override 
    110112        public void parse() throws ParserException { 
     113            String usedLogFile=null; 
    111114            try{ 
    112                 log.info("parsing log file: {}", logfile); 
    113                 URL logfileURL = new URL(logfile); 
     115                DateTime todaysDate = new DateTime(); 
     116                usedLogFile = logfile.replace("DATE",todaysDate.toString("yyyymmdd")); 
     117                log.info("parsing log file: {}", usedLogFile); 
     118                URL logfileURL = new URL(usedLogFile); 
    114119                URLConnection logfileconnection = logfileURL.openConnection(); 
    115120                BufferedReader in = new BufferedReader(new InputStreamReader(logfileconnection.getInputStream())); 
     
    118123            } 
    119124            catch (MalformedURLException e1) { 
    120                 throw new ParserException("Could not find the source file [" + logfile + "] for parsing", e1); 
     125                throw new ParserException("Could not find the source file [" + usedLogFile + "] for parsing", e1); 
    121126            } catch (IOException e2) { 
    122                 throw new ParserException("Could not read from the source file [" + logfile + "] during parsing", e2); 
     127                throw new ParserException("Could not read from the source file [" + usedLogFile + "] during parsing", e2); 
    123128            } 
    124129 
Note: See TracChangeset for help on using the changeset viewer.