CookieContainerクラスの設計
戻る
$ ./CookieContainer.sh http://www.infoseek.co.jp/ ../../etc/URLContent.properties
*** DEBUG *** in PropertyManager.getInstance() : PropertyManagerがインスタンス化されました!
*** DEBUG *** in PropertyManager.getInstance() : ../../etc/URLContent.properties の内容を読み取っています
*** DEBUG *** in CookieContainer.getInstance() : CookieContainerがインスタンス化されました!
/// COOKIE FOUND /// in CookieContainer.dump()
hostName = www.infoseek.co.jp
URL = http://www.infoseek.co.jp/
cookieInfo = InfoseekUserId=CB5BFE147EC4618449747EFFFB4711D4; domain=www.infoseek.co.jp; path=/; expires=Tuesday, 31-Dec-2030 23:59:59 GMT;SWID=
71992A50-899E-6339-4B90-DB01704A5536; domain=www.infoseek.co.jp; path=/; expires=Tuesday, 31-Dec-2030 23:59:59 GMT
[ 1] MIME-Version: 1.0
[ 2] Date: Mon, 20 Jun 2005 14:09:26 GMT
[ 3] Content-Type: text/html; charset=EUC-JP
[ 4] Set-Cookie: InfoseekUserId=CB5BFE147EC4618449747EFFFB4711D4; domain=www.infoseek.co.jp; path=/; expires=Tuesday, 31-Dec-2030 23:59:59 GMT
[ 5] Set-Cookie: SWID=71992A50-899E-6339-4B90-DB01704A5536; domain=www.infoseek.co.jp; path=/; expires=Tuesday, 31-Dec-2030 23:59:59 GMT
[ 6] Connection: Keep-Alive
[ 7] Content-Length: 58234
*** Adding HTTP Request header *** Cookie: InfoseekUserId=CB5BFE147EC4618449747EFFFB4711D4; domain=www.infoseek.co.jp; path=/; expires=Tuesday, 31-Dec-2
030 23:59:59 GMT;SWID=71992A50-899E-6339-4B90-DB01704A5536; domain=www.infoseek.co.jp; path=/; expires=Tuesday, 31-Dec-2030 23:59:59 GMT
[ 1] MIME-Version: 1.0
[ 2] Date: Mon, 20 Jun 2005 14:09:36 GMT
[ 3] Content-Type: text/html; charset=EUC-JP
[ 4] Connection: Keep-Alive
[ 5] Content-Length: 59113
*** Adding HTTP Request header *** Cookie: InfoseekUserId=CB5BFE147EC4618449747EFFFB4711D4; domain=www.infoseek.co.jp; path=/; expires=Tuesday, 31-Dec-2
030 23:59:59 GMT;SWID=71992A50-899E-6339-4B90-DB01704A5536; domain=www.infoseek.co.jp; path=/; expires=Tuesday, 31-Dec-2030 23:59:59 GMT
[ 1] MIME-Version: 1.0
[ 2] Date: Mon, 20 Jun 2005 14:09:36 GMT
[ 3] Content-Type: text/html; charset=EUC-JP
[ 4] Connection: Keep-Alive
[ 5] Content-Length: 58027
// 使用しているクラス
Compiled from "AbstractContent.java"
public abstract class IntelligentSpider.AbstractContent extends java.lang.Object implements IntelligentSpider.Retrievable{
protected java.lang.String bodyAsString;
protected java.lang.String title;
protected java.util.Set links;
public IntelligentSpider.AbstractContent();
protected java.lang.String getBodyAsString();
protected java.lang.String getTitle();
protected java.util.Set getLinks();
public void retrieve() throws java.lang.Exception;
}
Compiled from "AbstractObtainer.java"
public abstract class IntelligentSpider.AbstractObtainer extends java.lang.Object{
protected java.net.HttpURLConnection connection;
public IntelligentSpider.AbstractObtainer();
protected abstract void obtain() throws java.lang.Exception;
}
Compiled from "ConnectionPropertySetter.java"
public class IntelligentSpider.ConnectionPropertySetter extends java.lang.Object{
public IntelligentSpider.ConnectionPropertySetter();
public static void doSet(IntelligentSpider.URLContent);
}
Compiled from "CookieContainer.java"
public class IntelligentSpider.CookieContainer extends java.lang.Object{
private static IntelligentSpider.CookieContainer uniqueInstance;
private java.util.TreeMap cookieInfos;
private IntelligentSpider.CookieContainer();
public static IntelligentSpider.CookieContainer getInstance();
public java.util.TreeMap getCookieInfos();
public void setCookieInfo(IntelligentSpider.URLContent);
public java.lang.String getCookieInfo(java.lang.String);
private java.lang.String obtainCookieInfo(IntelligentSpider.URLContent);
private java.lang.String obtainCookieInfo4orbis(IntelligentSpider.URLContent);
private void dump(IntelligentSpider.URLContent, java.lang.StringBuffer);
public static void main(java.lang.String[]) throws java.lang.Exception;
}
Compiled from "FormInfoSender.java"
public class IntelligentSpider.FormInfoSender extends java.lang.Object{
private java.util.List pairs;
private java.net.URL url;
private java.net.URL redirectURL;
private java.lang.String cookieString;
public IntelligentSpider.FormInfoSender(java.lang.String) throws java.lang.Exception;
public void setPair(java.lang.String, java.lang.String);
public void send() throws java.lang.Exception;
public java.lang.String getCookieString();
public java.net.URL getRedirectURL();
public static void main(java.lang.String[]) throws java.lang.Exception;
}
Compiled from "ISUtils.java"
public class IntelligentSpider.ISUtils extends java.lang.Object{
public IntelligentSpider.ISUtils();
public static java.lang.String addDoubleQuote(java.lang.String);
public static java.lang.String addSingleQuote(java.lang.String);
public static boolean isEmpty(java.lang.String);
public static java.lang.StringBuffer trimQuote(java.io.StringReader);
public static java.lang.String getAbsolutePath(java.net.URL, java.lang.String);
public static java.lang.String getDirName(java.net.URL);
public static java.lang.String getParentPath(java.net.URL, java.lang.String);
public static java.lang.String getYYYYMMDD(java.util.Calendar);
public static java.lang.String getHHMISS(java.util.Calendar);
public static java.lang.String sha1Digest(java.lang.String);
public static java.lang.String doParseMetaTag(java.lang.String);
public static java.lang.String doEraseAnchorPart(java.lang.String);
public static java.lang.String doSanitation(java.lang.String);
public static java.lang.String doProcessJavaScriptLink(java.lang.String);
public static java.lang.String commaFormat(long, int);
public static java.lang.String getHHMISS(long);
public static void main(java.lang.String[]);
}
Compiled from "LinkFilter.java"
public class IntelligentSpider.LinkFilter extends java.lang.Object{
public IntelligentSpider.LinkFilter();
public static java.util.Set doFiltration(java.net.URL, java.util.Set, java.util.Properties);
}
Compiled from "LinkRetriever.java"
public class IntelligentSpider.LinkRetriever extends java.lang.Object{
public IntelligentSpider.LinkRetriever();
public static java.util.Set retrieve(java.net.URL, java.util.List, java.lang.String);
private static void getLinkFromLocationHeader(java.util.List, java.util.List);
private static void getHyperLinkInScriptSection(java.util.List, java.lang.String);
private static void getMetaTagLocationURL(java.util.List, java.lang.String);
private static void getValueOfFormInput(java.util.List, java.lang.String);
private static void getValueOfJavaScriptLink(java.util.List, java.lang.String);
private static void getValueOfHref(java.util.List, java.lang.String);
private static void getValueOfSrc(java.util.List, java.lang.String);
}
Compiled from "LocalFileContent.java"
public class IntelligentSpider.LocalFileContent extends IntelligentSpider.AbstractContent{
private java.io.File file;
public IntelligentSpider.LocalFileContent(java.lang.String) throws java.lang.Exception;
public void retrieve() throws java.lang.Exception;
public java.util.Set getLinks();
public static void main(java.lang.String[]);
}
Compiled from "PropertyManager.java"
public class IntelligentSpider.PropertyManager extends java.lang.Object{
private static IntelligentSpider.PropertyManager uniqueInstance;
private static java.util.Map propertiesMap;
private IntelligentSpider.PropertyManager();
private static void load(java.lang.String) throws IntelligentSpider.PropertyManagerLoadException, java.lang.Exception;
public static synchronized java.util.Properties getInstance(java.lang.String) throws java.lang.Exception;
public static void main(java.lang.String[]);
}
Compiled from "PropertyManagerLoadException.java"
public class IntelligentSpider.PropertyManagerLoadException extends java.lang.Exception{
public IntelligentSpider.PropertyManagerLoadException(java.lang.String);
}
Compiled from "ResponseBodyObtainer.java"
public class IntelligentSpider.ResponseBodyObtainer extends IntelligentSpider.AbstractObtainer{
public java.lang.StringBuilder sb;
public java.lang.String encoding;
public IntelligentSpider.ResponseBodyObtainer(java.net.HttpURLConnection, java.lang.String) throws java.lang.Exception;
public java.lang.String getBody();
protected void obtain() throws java.lang.Exception;
}
Compiled from "ResponseHeaderObtainer.java"
public class IntelligentSpider.ResponseHeaderObtainer extends IntelligentSpider.AbstractObtainer{
public java.util.List headers;
public IntelligentSpider.ResponseHeaderObtainer(java.net.HttpURLConnection) throws java.lang.Exception;
public java.util.List getHeaders();
protected void obtain() throws java.lang.Exception;
}
Compiled from "ResultTreeModel.java"
public class IntelligentSpider.ResultTreeModel extends java.lang.Object{
public IntelligentSpider.ResultTreeModel();
}
Compiled from "Retrievable.java"
public interface IntelligentSpider.Retrievable{
public abstract void retrieve() throws java.lang.Exception;
}
Compiled from "ScriptSectionLinkExtractor.java"
public class IntelligentSpider.ScriptSectionLinkExtractor extends java.lang.Object{
public IntelligentSpider.ScriptSectionLinkExtractor();
public static java.util.List getLinkURL(java.lang.String);
private static void getWindowOpen(java.lang.String, java.util.ArrayList);
private static void getLocationHref(java.lang.String, java.util.ArrayList);
private static java.util.List getScriptSections(java.lang.String);
public static void main(java.lang.String[]) throws java.lang.Exception;
}
Compiled from "SystemPropertySetter.java"
public class IntelligentSpider.SystemPropertySetter extends java.lang.Object{
public IntelligentSpider.SystemPropertySetter();
public static void doSet(java.util.Properties);
}
Compiled from "TitleExtractor.java"
public class IntelligentSpider.TitleExtractor extends java.lang.Object{
public IntelligentSpider.TitleExtractor();
public java.lang.String extract(java.lang.String);
}
Compiled from "URLContent.java"
public class IntelligentSpider.URLContent extends IntelligentSpider.AbstractContent{
private java.net.URL url;
private java.net.HttpURLConnection connection;
private java.util.List responseHeaders;
private java.util.Properties properties;
public IntelligentSpider.URLContent(java.lang.String, java.lang.String) throws java.lang.Exception;
public java.util.Properties getProperties();
private void loadProperties(java.lang.String) throws java.lang.Exception;
public java.net.HttpURLConnection getConnection();
private void setConnection() throws java.lang.Exception;
private void closeConnection();
public java.util.List getResponseHeaders();
private void setResponseHeader() throws java.lang.Exception;
private void setResponseBody() throws java.lang.Exception;
public void retrieve() throws java.lang.Exception;
private void parse();
public java.lang.String getHost();
public java.net.URL getUrl();
public static void main(java.lang.String[]) throws java.lang.Exception;
}
戻る