Examples of IEHistoryFileParser


Examples of isi.pasco2.parser.IEHistoryFileParser

            System.err.println("Using cache file parser.");
            logparser = new IECacheFileParser(fileName, fr, handler);
          } else if (fileType.equals("cache")) {
            logparser = new IECacheFileParser(fileName, fr, handler);
          } else if (fileType.equals("history")) {
            logparser = new IEHistoryFileParser(fileName, fr, handler);
          } else {
            System.err.println("Unsupported file type.");
            HelpFormatter formatter = new HelpFormatter();
            formatter.printHelp( "pasco2", options );
            System.exit(1);
View Full Code Here

Examples of isi.pasco2.parser.IEHistoryFileParser

  
   //DifferenceHandler cacheHandler = new DifferenceHandler("Cache");
   DifferenceHandler historyHandler = new DifferenceHandler("History");
  
   //IEIndexFileParser cacheparser = new IEIndexFileParser();
   IEHistoryFileParser historyParser ;
  
   while (true) {
      try {
        //IndexFile f1 = new FastReadIndexFile(cachePath);
        //cacheparser.parseFile(cachePath, f1, cacheHandler);
        //f1.close();
  
        IndexFile f2 = new FastReadIndexFile(historyPath);
        historyParser = new IEHistoryFileParser(cachePath, f2, historyHandler);
        historyParser.parseFile();
        f2.close();
       
        try {
          Thread.sleep(10000);
        } catch (InterruptedException ex) {
View Full Code Here

Examples of isi.pasco2.parser.IEHistoryFileParser

  public void testEmptyHistoryFile() {
    try {
      String f = "D:\\mysrc\\pasco2\\src\\test\\isrc\\pasco2\\empty.history.index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      IEIndexFileParser parser = new IEHistoryFileParser(f, fr);
      parser.parseFile();

      ValidRecordIterator it = parser.getValidRecords();
      int count = 0;
      while (it.hasNext()) {
        count += 1;
        it.next();
      }
View Full Code Here

Examples of isi.pasco2.parser.IEHistoryFileParser

  public void testInitialHistoryFile() {
    try {
      String f = "D:\\mysrc\\pasco2\\src\\test\\isrc\\pasco2\\first.history.index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      IEIndexFileParser parser = new IEHistoryFileParser(f, fr);

      ValidRecordIterator it = parser.getValidRecords();
      int count = 0;
      while (it.hasNext()) {
        count += 1;
        it.next();
      }
View Full Code Here

Examples of isi.pasco2.parser.IEHistoryFileParser

  public void testHistoryFile() {
    try {
      String f = "D:\\Documents and Settings\\bschatz\\Local Settings\\History\\History.IE5\\index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      CountingCacheHandler handler = new CountingCacheHandler();
      IEHistoryFileParser parser = new IEHistoryFileParser(f, fr);
     
      int allocatorBitMapOffset = 0x250;
      int bitMapIndex = 0;
      int storageStart = 0x4000;
      parser.primaryHashOffset = storageStart;
      int address = 0;
      while (address != storageStart) {
        fr.seek(allocatorBitMapOffset + bitMapIndex*4);

        int[] bitmap = {fr.readLittleEndianInt()};
        BitArray bits = new BitArray(32, bitmap);
        for (int i = 0 ; i < 32 ; i++ ){
          address = (bitMapIndex*32+i) * 0x80 + storageStart;
          fr.seek(address);
          int dword = fr.readLittleEndianInt();
 
          System.out.println((bitMapIndex*32+i) + " " + Integer.toHexString(dword) + " " + Integer.toHexString(address));
          assertTrue(bits.getBit(i) == parser.getAllocator().isRecordAllocated(address));

        }
        bitMapIndex += 1;
      }
    } catch (Exception e) {
View Full Code Here

Examples of isi.pasco2.parser.IEHistoryFileParser

  public void testCacheFile() {
    try {
      String f = "D:\\mysrc\\squidbro\\IFIP2006\\anon\\source\\minnow.willk.content.index.dat";
      IndexFile fr = new FastReadIndexFile(f, "r");
      CountingCacheHandler handler = new CountingCacheHandler();
      IEHistoryFileParser parser = new IEHistoryFileParser(f, fr);
     
      int allocatorBitMapOffset = 0x250;
      int bitMapIndex = 0;
      int storageStart = 0x5000;
      parser.primaryHashOffset = storageStart;
      int address = 0;
      while (address != storageStart) {
        fr.seek(allocatorBitMapOffset + bitMapIndex*4);

        int[] bitmap = {fr.readLittleEndianInt()};
        BitArray bits = new BitArray(32, bitmap);
        for (int i = 0 ; i < 32 ; i++ ){
          address = (bitMapIndex*32+i) * 0x80 + storageStart;
          fr.seek(address);
          int dword = fr.readLittleEndianInt();
 
          System.out.println((bitMapIndex*32+i) + " " + Integer.toHexString(dword) + " " + Integer.toHexString(address));
          assertTrue(bits.getBit(i) == parser.getAllocator().isRecordAllocated(address));

        }
        bitMapIndex += 1;
      }
    } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.