|
Kagetaka | |||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjava.net.URLConnection
java.net.HttpURLConnection
net.hizlab.kagetaka.protocol.http.HawkHttpURLConnection
HTTP クライアントの基本的な機能を提供します。
フィールドの概要 | |
protected static String |
ACCEPT_STRING
受け付けるコンテンツタイプ |
protected URLConnectionCache.Entry |
cacheEntry
キャッシュエントリー |
protected HttpClient |
http
HTTP クライアント |
protected static String |
HTTP_VERSION
HTTP バージョン |
protected InputStream |
inputStream
インプットストリーム |
protected boolean |
instanceFollowRedirects
リダイレクトを行うかどうか |
protected static int |
maxRedirects
最大転送回数 |
protected String |
proxyHost
プロキシホスト |
protected int |
proxyPort
プロキシポート |
protected Exception |
rememberedException
発生している例外 |
protected MessageHeader |
requests
リクエスト |
protected boolean |
responseException
HTTP レスポンスが 400 以上で例外を発生させるかどうか |
protected MessageHeader |
responses
レスポンス |
protected boolean |
usingProxy
プロキシを使用するかどうか |
クラス java.net.URLConnection から継承したフィールド |
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches |
メソッドの概要 | |
protected void |
checkIOException(IOException exception)
指定された例外が起きた場合に再試行してはいけない場合に、 例外をスローします。 |
protected void |
checkMessageHeader(String key,
String value)
メッセージヘッダーが正しいかをチェックし、整形します。 |
void |
connect()
接続を行います。 |
void |
disconnect()
切断します。 |
String |
getCachePath()
キャッシュファイルのパスを返します。 |
protected String |
getConnectURL()
HTTP リクエストに使用するリクエスト文字列を返します。 |
protected int |
getDefaultPort()
デフォルトポートを返します。 |
InputStream |
getErrorStream()
HTTP エラーが発生した場合(レスポンスコードが 400 以上)に、 入力ストリームを返します。 |
String |
getHeaderField(int n)
ヘッダーフィールドを返します。 |
String |
getHeaderField(String name)
ヘッダーフィールドを返します。 |
String |
getHeaderFieldKey(int n)
ヘッダーフィールドを返します。 |
protected String |
getHostHeader(boolean mustPort)
URLConnection.url を元にした Host ヘッダー用の文字列を返します。 |
InputStream |
getInputStream()
入力ストリームを返します。 |
boolean |
getInstanceFollowRedirects()
リダイレクトを行うかどうかを返します。 |
OutputStream |
getOutputStream()
リクエストで出力する出力ストリームを戻します。 |
String |
getRequestProperty(String key)
リクエストプロパティを返します。 |
int |
getResponseCode()
HTTP レスポンスコードを返します。 |
protected void |
plainConnect()
直接接続します。 |
protected void |
proxiedConnect()
プロキシ経由で接続します。 |
protected void |
release()
リソースを解放します。 |
void |
removeCache()
キャッシュデータを破棄します。 |
void |
setInstanceFollowRedirects(boolean followRedirects)
リダイレクトを行うかどうかを設定します。 |
void |
setRequestProperty(String key,
String value)
リクエストプロパティを設定します。 |
void |
setupCache(CacheManager cm,
PostData pd)
キャッシュマネージャを使用できるようにセットアップします。 |
protected void |
setupProxy(String host,
int port)
プロキシを設定します。 |
protected MessageHeader |
setupRequests()
HTTP リクエストヘッダーをセットアップし、 接続に使用するリクエストヘッダーを返します。 |
boolean |
usingProxy()
プロキシを利用するかどうかを返します。 |
クラス java.net.HttpURLConnection から継承したメソッド |
getFollowRedirects, getHeaderFieldDate, getPermission, getRequestMethod, getResponseMessage, setFollowRedirects, setRequestMethod |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
フィールドの詳細 |
protected static final String ACCEPT_STRING
protected URLConnectionCache.Entry cacheEntry
protected HttpClient http
protected static final String HTTP_VERSION
protected InputStream inputStream
protected boolean instanceFollowRedirects
protected static int maxRedirects
protected String proxyHost
protected int proxyPort
protected Exception rememberedException
protected MessageHeader requests
protected boolean responseException
protected MessageHeader responses
protected boolean usingProxy
メソッドの詳細 |
protected void checkIOException(IOException exception) throws IOException
exception
- 例外
IOException
- スローする例外protected void checkMessageHeader(String key, String value)
key
- キーvalue
- 値不正なヘッダーの場合
public void connect() throws IOException
IOException
- IO エラーが発生した場合public void disconnect()
public String getCachePath()
CacheSupported
内の getCachePath
protected String getConnectURL()
protected int getDefaultPort()
public InputStream getErrorStream()
public String getHeaderField(int n)
n
- ヘッダー位置
public String getHeaderField(String name)
name
- キー
public String getHeaderFieldKey(int n)
n
- ヘッダー位置
protected String getHostHeader(boolean mustPort)
URLConnection.url
を元にした Host ヘッダー用の文字列を返します。
mustPort
- ポートを必ず付加するかどうか
public InputStream getInputStream() throws IOException
IOException
- IO エラーが発生した場合public boolean getInstanceFollowRedirects()
true
、
しない場合は false
public OutputStream getOutputStream() throws IOException
IOException
- IO エラーが発生した場合public String getRequestProperty(String key)
key
- キー
public int getResponseCode() throws IOException
IOException
- IO エラーが発生した場合protected void plainConnect() throws IOException
IOException
- IO エラーが発生した場合protected void proxiedConnect() throws IOException
IOException
- IO エラーが発生した場合protected void release()
public void removeCache()
CacheSupported
内の removeCache
public void setInstanceFollowRedirects(boolean followRedirects)
followRedirects
- リダイレクトする場合は true
、
しない場合は false
public void setRequestProperty(String key, String value)
key
- キーvalue
- 値public void setupCache(CacheManager cm, PostData pd)
CacheSupported
内の setupCache
cm
- キャッシュマネージャpd
- POST データprotected void setupProxy(String host, int port)
host
- ホスト、使用しない場合は null
port
- ポート、使用しない場合は -1
protected MessageHeader setupRequests()
このメソッド内で、requests
フィールドを設定し、
実際のリクエストで使用するリクエストヘッダーを戻り値として
返す必要があります。これにより、URLConnection を使用している
クライアントに返すリクエストヘッダーの値と、
実際に送信するリクエストヘッダーを別にすることが出来ます。
public boolean usingProxy()
true
、
利用しない場合は false
|
Kagetaka | |||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
Copyright (c) 2002-2004 The Kagetaka Project 'November 20, 2004'