Changeset 11694


Ignore:
Timestamp:
2006-04-26T09:18:42+12:00 (18 years ago)
Author:
shaoqun
Message:

add code to check whether document_root is null

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/java/org/nzdl/gsdl/GsdlCollageApplet/DownloadUrls.java

    r11645 r11694  
    366366        // get the image from the url
    367367        if (verbosity_>=2) {
    368         //System.err.println("  ****Downloading image URL: " + url.toString());
    369         }
    370 
    371             //System.out.println("add image**"+url.toString());
    372         //System.out.println("***** URL Path**"+from_url);
    373         //System.out.println("*** imagename**"+img_name);
    374 
     368        System.err.println("  Downloading image URL: " + url.toString());
     369        }
     370           
    375371           if (image_visited(url.toString(),img_name)) return;
    376372
     
    401397    public void rec_add_images(String new_url, int depth)
    402398    {
    403 
     399   
    404400    if (already_visited(new_url)) return;
    405401
     
    424420        // get all the <code><img src=</code> links into a vector
    425421        Vector src_links = curl.getSrcLinks();
    426        
     422
     423               
    427424        if (verbosity_ >= 2) {
    428425        System.err.println("  Got src links... there are " + src_links.size() + " of them.");
     
    487484        for (int i = 0; i < href_links.size(); i++)
    488485        {
     486           
    489487            URL url = (URL)href_links.get(i);
    490488            String url_string  = url.toString();
     
    517515                if (filter_href(url_string,new_url,depth))
    518516                {
     517       
    519518                    rec_add_images(url_string,depth+1);
    520519                   
     
    539538    public void externalLinks() {
    540539    external_links_ = null;
    541 
    542540    try {
    543541
    544         if (starting_url_.indexOf(document_root_) >= 0 ){
     542        if (starting_url_ == null || (document_root_ != null && starting_url_.indexOf(document_root_) >= 0) ){
    545543        return;
    546544        }
     
    556554        // split the line of the space, first part is the image, second part the link
    557555        while (l != null) {
    558 
     556   
    559557        String tmp1 = new String();
    560558        String tmp2 = new String();
     
    569567           
    570568            if (tmp2 != null) {
     569           
    571570            external_links_.put(tmp1, tmp2);
    572571            //System.err.println(tmp1 + " " + tmp2);
Note: See TracChangeset for help on using the changeset viewer.