public void populateURL()
    {
        String c_url;
        int i;
        //Storing the urls parsed in this vector.. stop when length >=crawlDepth*maxURLCount
        Iterator it;
        //URL of string has been populated initially..
        //Set initial crawled count to URLs crawled via the google API
        synchronized(ob)
        {
            ob.count+= urlList.size();
        }
        int maxCrawlCount = crawlDepth * maxURLCount;
        it = urlList.iterator();
        int index=0;
        while(index<urlList.size())
        {
            synchronized(this)
            {
                c_url=urlList.elementAt(index++);
            }
            if(c_url.length()==0)
            {
                continue;
            }
            System.out.println("URL "+c_url );
            synchronized(wch)
            {
                wch.crawlHistory.append(c_url + "\n");
                Integer val = ob.count;
                wch.total.setText("Total crawled: " + val.toString());
            }
            String type ="";
            
                if(ob.count<maxCrawlCount)
                {
                    try
                    {
                    //Can crawl the current URL and get data & links too
                        //type = getType(c_url);
                        if(isAllowedType(type))
                        {
                            if(!type.equals("application/pdf"))
                            {
                                Document doc = Jsoup.connect(c_url).get();
                                Elements links = doc.select("a[href]");
                                //set depth to the minimum of the links size and the crawl depth
                                int depth = crawlDepth>links.size()?links.size():crawlDepth;
                                for(i=0;i<depth;i++)
                                {
                                    Element link_el = links.get(i);
                                    String parsed_url = link_el.attr("abs:href");
                                    synchronized(urls)
                                    {
                                        
                                        if(!urls.containsKey(parsed_url))
                                        {                                           
                                            urls.put(parsed_url,null);
                                            ob.count++;
                                            synchronized(urlList)
                                            {
                                                urlList.add(parsed_url);
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                
                            }
                        }
                        else
                        {
                            
                        }
                    }
                    catch(Exception ex)
                    {
                        System.out.println("Error in parsing the document with URL : " + c_url +" "+ex.toString()+ " hello " +c_url.length());
                        //break;
                    }

                }
                else
                {
                    //All crawling of URL is done..Just get the content.. Just can retrive data and not get URLs anymore                    
                    System.out.println("Limit Reached..Just fetch data from "+c_url);
                    break;
                }            
        }        
    }