downloadResources(address, tokens, resources);
for(int i = 0; i < tokens.size(); i++) {
NodeImpl token = tokens.get(i);
if(token.getType() != TypeToken.TAG || !token.isNode(Name.A)) continue;
Attributes attributes = token.getAttributes();
Attribute attribute = attributes.get("href");
if(attribute == null) continue;
String link = attribute.getValue();
if(link == null || link.trim().length() < 1) continue;
link = urlUtils.createURL(parent, link);
String subName = "";
try {
URL subUrl = new URL(link);
String temp = subUrl.getPath();
if(temp != null) subName += temp;
temp = subUrl.getQuery();
if(temp != null) subName += "_"+temp;
subName = toName(subName);
}catch (Exception e) {
}
if(subName == null || subName.trim().length() < 1) subName = toName(link);
try{
crawl(new URL(address), link, subName, level+1, depth);
}catch (Exception e) {
System.err.println(e);
}
attribute.setValue(subName+".html");
attributes.set(attribute);
}
StringBuilder contentBuilder = new StringBuilder();
for(int i = 0; i < tokens.size(); i++) {