package javaCrawler;

import report.Error;
import report.Report;
import report.Respons;

public class SpiderManager {
	
	public SpiderManager(String url){
		
		UrlToVisit.getInstance().setLinkToVisit(url, new Url(url));

		this.spider();
		
	}
	
	
	private void spider(){

		while(!UrlToVisit.getInstance().isEmpty() ){

			Crawler crawler = new Crawler();

			Url analyzedRecord = (Url) UrlToVisit.getInstance().next();

			UrlVisited.getInstance().add(analyzedRecord.getUrl());
			

			Url currentRecord = (Url) crawler.search(analyzedRecord);
 
			logManager(currentRecord);
		}//end while
		
	}
	
	private void logManager(Url record){
		
		if(record.isLogError()){
			Error.getInstance().writeLog(record);
		}
		else{
			Report.getInstance().writeLog(record);
			Respons.getInstance().writeLog(record);
		}
		
		
	}

}

@@ -88,16 +88,86 @@
 ons;%0D%0A%0D%0A
+/**%0D%0A* @author Giuseppe Giorgi %3Cgiuseppe.giorgi1987@gmail.com%3E%0D%0A*/%0D%0A%0D%0A
 public c

Update SpiderManager.java