Package net.sf.regain.crawler.access

Examples of net.sf.regain.crawler.access.AccountPasswordEntry


        String key = (String) iter.next();
        String parts[] = key.split("\\.");

        String url = CrawlerToolkit.createURLFromProps(parts);
        // Check for url in HashMap
        AccountPasswordEntry acPassEntry;
        if (accountPasswordStore.containsKey(url)) {
          acPassEntry = accountPasswordStore.get(url);
        } else {
          acPassEntry = new AccountPasswordEntry();
        }

        if (key.indexOf(".account") != -1) {
          acPassEntry.setAccountName(URLEncoder.encode(authProps.getProperty(key), "UTF-8"));
          mLog.debug("Found account name: " + acPassEntry.getAccountName() + " for auth entry: " + url);
        } else if (key.indexOf(".password") != -1) {
          Base64 decoder = new Base64();
          acPassEntry.setPassword(new String(decoder.decode(authProps.getProperty(key))));
          mLog.debug("Found password for auth entry: " + url);
        }
        // write the updated entry back to hashtable
        mLog.debug("write entry for url >" + url + "<" + " with username/password into authentication store.");
        accountPasswordStore.put(url, acPassEntry);
View Full Code Here

TOP

Related Classes of net.sf.regain.crawler.access.AccountPasswordEntry

Copyright © 2018 www.massapicom. 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.