View Javadoc

1   package org.paneris.bibliomania.metasearch.bob;
2   
3   import org.paneris.bibliomania.metasearch.util.HackParser;
4   
5   public class FrontPage extends HackParser {
6     private static final byte[] bvsessionid = "NAME=\"BV_SessionID\"".getBytes(),
7       valueq = "VALUE=\"".getBytes(),
8       bvengineid = "NAME=\"BV_EngineID\"".getBytes();
9   
10    public String sessionID, engineID;
11  
12    public FrontPage(byte[] text) {
13      super(text);
14      try {
15        skipTo(bvsessionid);
16        skipTo(valueq);
17        int sid = here;
18        skipTo((byte)'"');
19        sessionID = new String(text, sid, here - sid - 1);
20  
21        skipTo(bvengineid);
22        skipTo(valueq);
23        int eid = here;
24        skipTo((byte)'"');
25        engineID = new String(text, eid, here - eid - 1);
26      } catch (Exception e) {
27        sessionID = null;
28        engineID = null;
29      }
30    }
31  }