String fileName = line.getArgs()[0];
try {
IndexFile fr = new FastReadIndexFile(fileName, "r");
CountingCacheHandler handler = null;
if (fileType == null) {
handler = new CountingCacheHandler();
}
if (fileType == null) {
handler = new CountingCacheHandler();
} else if (fileType.equals("cache")) {
handler = new CountingCacheHandler();
} else if (fileType.equals("history")) {
handler = new Pasco2HistoryHandler();
}
if (format != null) {
if (format.equals("pasco")) {
DateFormat regularDateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.SSS");
handler.setDateFormat(regularDateFormat);
TimeZone tz = TimeZone.getTimeZone("Australia/Brisbane");
regularDateFormat.setTimeZone(tz);
} else if (format.equals("standard")) {
DateFormat xsdDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
handler.setDateFormat(xsdDateFormat);
xsdDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
} else {
System.err.println("Format not supported.");
HelpFormatter formatter = new HelpFormatter();
formatter.printHelp( "pasco2", options );
System.exit(1);
}
}
if (delimeter != null) {
handler.setDelimeter(delimeter);
}
IEIndexFileParser logparser = null;
if (fileType == null) {
System.err.println("Using cache file parser.");