/** * GetURLs.java **/ import java.io.*; import java.net.*; import java.util.*; public class GetURLs { /** タグのリーダ */ ReadTag reader; public GetURLs(URL theURL) throws IOException { reader = new ReadTag(theURL); } public GetURLs(String theURL) throws MalformedURLException, IOException { reader = new ReadTag(theURL); } /** 抽出対象となるタグ */ public final static String[] wantTags = { "i+1){ try{ i++; System.out.print("["+i+"]"); Object objurl = MAP.BaseSet.get(i); String theURL = objurl.toString(); if(theURL.startsWith("http://www.nias.affrc.go.jp/")){ System.out.println("continue"); continue; } GetURLs gu = new GetURLs(theURL); ArrayList urls = new ArrayList(gu.getURLs()); /*取ってきたアンカーを表示 System.out.println("***************"); Tools.Output(urls); System.out.println("***************"); */ // 親URLの修正 String tmp_theURL = Change.Change_theURL(theURL); int size = urls.size(); for(int j=0;jから[???.html]を抜きだす***/ int e_index = tmp_url1.indexOf("\"",9); String tmp_url2 = tmp_url1.substring(9,e_index); if(Check.EndCheck(tmp_url2)==-1) //拡張子等判定 continue; /***[if] 「0 || home>0){// 親URLのディレクトリ修正 String cd_theURL = Change.cd_theURL(tmp_theURL,cd,home); tmp_theURL1 = new StringBuffer(cd_theURL); }else{ tmp_theURL1 = new StringBuffer(tmp_theURL); } tmp_theURL1.append(tmp_url2); String tmp_theURL2 = tmp_theURL1.toString(); if(Check.LoopCheck(MAP,tmp_theURL2,theURL)==0){ MAP.LHMap.put(tmp_theURL2,theURL); if(Check.LoopCheck_BS(MAP,tmp_theURL2)==0) MAP.BaseSet.add(tmp_theURL2); }else{ if(Check.LoopCheck_Oya(MAP,tmp_theURL2,theURL)==0){ MAP.DiffOya.add(theURL); MAP.DiffOya.add(tmp_theURL2); } } } // end if{ /***[else] 「