public void start ( ) { log . info ( "Starting spider..." ) ; this . timeStarted = System . currentTimeMillis ( ) ; fetchFilterSeeds ( ) ; // Check if seeds are available, otherwise the Spider will start, but will not have any // seeds and will not stop. if ( seedList == null || seedList . isEmpty ( ) ) { log . warn ( "No seeds available for the Spider. Cancelling scan..." ) ; notifyListenersSpiderComplete ( false ) ; notifyListenersSpiderProgress ( 100 , 0 , 0 ) ; return ; } if ( scanUser != null ) log . info ( "Scan will be performed from the point of view of User: " + scanUser . getName ( ) ) ; this . controller . init ( ) ; this . stopped = false ; this . paused = false ; this . initialized = false ; // Initialize the thread pool this . threadPool = Executors . newFixedThreadPool ( spiderParam . getThreadCount ( ) , new SpiderThreadFactory ( "ZAP-SpiderThreadPool-" + id + "-thread-" ) ) ; // Initialize the HTTP sender httpSender = new HttpSender ( connectionParam , connectionParam . isHttpStateEnabled ( ) ? true : ! spiderParam . isAcceptCookies ( ) , HttpSender . SPIDER_INITIATOR ) ; // Do not follow redirections because the request is not updated, the redirections will be // handled manually. httpSender . setFollowRedirect ( false ) ; // Add the seeds for ( URI uri : seedList ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Adding seed for spider: " + uri ) ; } controller . addSeed ( uri , HttpRequestHeader . GET ) ; } // Mark the process as completely initialized initialized = true ; }
Starts the Spider crawling .