code: public void setMaxDepth(int maxDepth) {
  		this.maxDepth = maxDepth > UNLIMITED_DEPTH ? maxDepth : UNLIMITED_DEPTH;
  		getConfig().setProperty(SPIDER_MAX_DEPTH, Integer.toString(this.maxDepth));
  
  	}
docs: Sets the maximum depth the spider can crawl.
  <p>
  Value {@value #UNLIMITED_DEPTH} for unlimited depth.
  
  @param maxDepth the new maximum depth.
  @see #getMaxDepth()