Kagetaka

net.hizlab.kagetaka.net
クラス URLConnectionWrapper

java.lang.Object
  拡張java.net.URLConnection
      拡張net.hizlab.kagetaka.net.URLConnectionWrapper
直系の既知のサブクラス:
URLConnectionWrapper12

public class URLConnectionWrapper
extends URLConnection

URLConnection ラッパーです。

バージョン:
$Revision: 1.3 $

フィールドの概要
protected  URLConnection connection
          コネクション
protected  InputStream inputStream
          入力ストリーム
 
クラス java.net.URLConnection から継承したフィールド
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
コンストラクタの概要
URLConnectionWrapper(URL url, URLConnection connection, InputStream is)
          URLConnection のラッパークラスを作成します。
 
メソッドの概要
 void connect()
          接続を行います。
 boolean equals(Object obj)
          このオブジェクトと他のオブジェクトが等しいかどうかを示します。
 boolean getAllowUserInteraction()
          allowUserInteraction フィールド値を返します。
 Object getContent()
          この URL 接続のコンテンツを取得します。
 String getContentEncoding()
          content-encoding ヘッダフィールドの値を返します。
 int getContentLength()
          content-length ヘッダフィールドの値を返します。
 String getContentType()
          content-type ヘッダフィールドの値を返します。
 long getDate()
          date ヘッダフィールドの値を返します。
 boolean getDefaultUseCaches()
          useCaches フラグのデフォルト値を返します。
 boolean getDoInput()
          doInput フラグの値を返します。
 boolean getDoOutput()
          doOutput フラグの値を返します。
 long getExpiration()
          expires ヘッダフィールドの値を返します。
 String getHeaderField(int n)
          n 番目のヘッダフィールドの値を返します。
 String getHeaderField(String name)
          指定されたヘッダフィールドの値を返します。
 long getHeaderFieldDate(String name, long def)
          指定されたフィールドを日付として解析した値を返します。
 int getHeaderFieldInt(String name, int def)
          指定されたフィールドを数値として解析した値を返します。
 String getHeaderFieldKey(int n)
          n 番目のヘッダフィールドのキーを返します。
 long getIfModifiedSince()
          ifModifiedSince フィールド値を返します。
 InputStream getInputStream()
          入力ストリームを返します。
 long getLastModified()
          last-modified ヘッダフィールドの値を返します。
 OutputStream getOutputStream()
          リクエストで出力する出力ストリームを戻します。
 String getRequestProperty(String key)
          リクエストプロパティを返します。
 URL getURL()
          URL フィールド値を返します。
 boolean getUseCaches()
          useCaches フィールド値を返します。
 int hashCode()
          オブジェクトのハッシュコード値を返します。
 void setAllowUserInteraction(boolean allowuserinteraction)
          allowUserInteraction フィールド値を設定します。
 void setDefaultUseCaches(boolean defaultusecaches)
          useCaches フィールドのデフォルト値を、 指定された値に設定します。
 void setDoInput(boolean doinput)
          doInput フィールド値を指定した値に設定します。
 void setDoOutput(boolean dooutput)
          doOutput フィールドの値を、指定された値に設定します。
 void setIfModifiedSince(long ifmodifiedsince)
          ifModifiedSince フィールド値を、指定された値に設定します。
 void setRequestProperty(String key, String value)
          リクエストプロパティを設定します。
 void setUseCaches(boolean usecaches)
          useCaches フィールドを、指定された値に設定します。
 String toString()
          オブジェクトの文字列表現を返します。
 
クラス java.net.URLConnection から継承したメソッド
addRequestProperty, getContent, getDefaultAllowUserInteraction, getDefaultRequestProperty, getFileNameMap, getHeaderFields, getPermission, getRequestProperties, guessContentTypeFromName, guessContentTypeFromStream, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setFileNameMap
 
クラス java.lang.Object から継承したメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

connection

protected URLConnection connection
コネクション


inputStream

protected InputStream inputStream
入力ストリーム

コンストラクタの詳細

URLConnectionWrapper

public URLConnectionWrapper(URL url,
                            URLConnection connection,
                            InputStream is)
URLConnection のラッパークラスを作成します。

パラメータ:
url - URL
connection - コネクション
is - 入力ストリーム。 connection から取得する場合は null
関連項目:
URLConnection
メソッドの詳細

connect

public void connect()
             throws IOException
接続を行います。

例外:
IOException - サーバへの接続でエラーが発生した場合
関連項目:
URLConnection.connect()

equals

public boolean equals(Object obj)
このオブジェクトと他のオブジェクトが等しいかどうかを示します。

パラメータ:
obj - 比較対象の参照オブジェクト
戻り値:
obj 引数に指定されたオブジェクトとこのオブジェクトが等しい場合は true、そうでない場合は false
関連項目:
Object.equals(Object)

getAllowUserInteraction

public boolean getAllowUserInteraction()
allowUserInteraction フィールド値を返します。

戻り値:
allowUserInteraction フィールド値
関連項目:
URLConnection.getAllowUserInteraction()

getContent

public Object getContent()
                  throws IOException
この URL 接続のコンテンツを取得します。

戻り値:
取得したオブジェクト
例外:
IOException - サーバへの接続でエラーが発生した場合
UnknownServiceException - プロトコルがそのコンテンツ形式をサポートしていない場合
関連項目:
URLConnection.getContent()

getContentEncoding

public String getContentEncoding()
content-encoding ヘッダフィールドの値を返します。

戻り値:
URL が参照するリソースのコンテンツの符号化。 不明の場合は null
関連項目:
URLConnection.getContentEncoding()

getContentLength

public int getContentLength()
content-length ヘッダフィールドの値を返します。

戻り値:
この接続の URL が参照するリソースのコンテンツサイズ。 サイズが不明の場合は -1
関連項目:
URLConnection.getContentLength()

getContentType

public String getContentType()
content-type ヘッダフィールドの値を返します。

戻り値:
URL が参照するリソースのコンテンツ形式。 不明の場合は null
関連項目:
URLConnection.getContentType()

getDate

public long getDate()
date ヘッダフィールドの値を返します。

戻り値:
URL が参照するリソースの送信日。 不明の場合は 0。 戻り値はグリニッジ標準時 1970 年 1 月 1 日 から起算したミリ秒数
関連項目:
URLConnection.getDate()

getDefaultUseCaches

public boolean getDefaultUseCaches()
useCaches フラグのデフォルト値を返します。

戻り値:
useCaches フラグのデフォルト値
関連項目:
URLConnection.getDefaultUseCaches()

getDoInput

public boolean getDoInput()
doInput フラグの値を返します。

戻り値:
doInput フラグの値
関連項目:
URLConnection.getDoInput()

getDoOutput

public boolean getDoOutput()
doOutput フラグの値を返します。

戻り値:
doOutput フラグの値
関連項目:
URLConnection.getDoOutput()

getExpiration

public long getExpiration()
expires ヘッダフィールドの値を返します。

戻り値:
この URL が参照するリソースの有効期限。 不明の場合は 0。 値はグリニッジ標準時 1970 年 1 月 1 日 から起算したミリ秒数
関連項目:
URLConnection.getExpiration()

getHeaderField

public String getHeaderField(int n)
n 番目のヘッダフィールドの値を返します。

パラメータ:
n - インデックス
戻り値:
n 番目のヘッダフィールドの値。 フィールドの数が n 個よりも少ない場合は null
関連項目:
URLConnection.getHeaderField(int)

getHeaderField

public String getHeaderField(String name)
指定されたヘッダフィールドの値を返します。

パラメータ:
name - ヘッダフィールドの名前
戻り値:
指定されたヘッダフィールドの名前。 指定された名前を持つフィールドがヘッダ内にない場合は null
関連項目:
URLConnection.getHeaderField(String)

getHeaderFieldDate

public long getHeaderFieldDate(String name,
                               long def)
指定されたフィールドを日付として解析した値を返します。

パラメータ:
name - ヘッダフィールドの名前
def - デフォルト値
戻り値:
日付として解析したフィールド値。 フィールドがないか、またはフィールドの形式が不正な場合は def 引数の値
関連項目:
URLConnection.getHeaderFieldDate(String, long)

getHeaderFieldInt

public int getHeaderFieldInt(String name,
                             int def)
指定されたフィールドを数値として解析した値を返します。

パラメータ:
name - ヘッダフィールドの名前
def - デフォルト値
戻り値:
指定したフィールドの値を整数として解析した値。 フィールドがないか、またはフィールドの形式が不正の場合には def 引数の値
関連項目:
URLConnection.getHeaderFieldInt(String, int)

getHeaderFieldKey

public String getHeaderFieldKey(int n)
n 番目のヘッダフィールドのキーを返します。

パラメータ:
n - インデックス
戻り値:
n 番目のヘッダフィールドのキー。 フィールドの数が n 個よりも少ない場合は null
関連項目:
URLConnection.getHeaderFieldKey(int)

getIfModifiedSince

public long getIfModifiedSince()
ifModifiedSince フィールド値を返します。

戻り値:
ifModifiedSince フィールド値
関連項目:
URLConnection.getIfModifiedSince()

getInputStream

public InputStream getInputStream()
                           throws IOException
入力ストリームを返します。

戻り値:
入力ストリーム
例外:
IOException - サーバへの接続でエラーが発生した場合
UnknownServiceException - プロトコルが入力をサポートしていない場合
関連項目:
URLConnection.getInputStream()

getLastModified

public long getLastModified()
last-modified ヘッダフィールドの値を返します。

戻り値:
URL が参照するリソースが変更された日付。 不明の場合は 0。 戻り値はグリニッジ標準時 1970 年 1 月 1 日 から起算したミリ秒数
関連項目:
URLConnection.getLastModified()

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
リクエストで出力する出力ストリームを戻します。

戻り値:
出力ストリーム
例外:
IOException - サーバへの接続でエラーが発生した場合
UnknownServiceException - プロトコルが出力をサポートしていない場合
関連項目:
URLConnection.getOutputStream()

getRequestProperty

public String getRequestProperty(String key)
リクエストプロパティを返します。

パラメータ:
key - キー
戻り値:
リソースの値
例外:
IllegalStateException - すでに接続されている場合
関連項目:
URLConnection.getRequestProperty(String)

getURL

public URL getURL()
URL フィールド値を返します。

戻り値:
URL フィールド値
関連項目:
URLConnection.getURL()

getUseCaches

public boolean getUseCaches()
useCaches フィールド値を返します。

戻り値:
useCaches フィールド値
関連項目:
URLConnection.getUseCaches()

hashCode

public int hashCode()
オブジェクトのハッシュコード値を返します。

戻り値:
ハッシュコード値
関連項目:
Object.hashCode()

setAllowUserInteraction

public void setAllowUserInteraction(boolean allowuserinteraction)
allowUserInteraction フィールド値を設定します。

パラメータ:
allowuserinteraction - 新しい値
例外:
IllegalStateException - すでに接続されている場合
関連項目:
URLConnection.setAllowUserInteraction(boolean)

setDefaultUseCaches

public void setDefaultUseCaches(boolean defaultusecaches)
useCaches フィールドのデフォルト値を、 指定された値に設定します。

パラメータ:
defaultusecaches - 新しい値
関連項目:
URLConnection.setDefaultUseCaches(boolean)

setDoInput

public void setDoInput(boolean doinput)
doInput フィールド値を指定した値に設定します。

パラメータ:
doinput - 新しい値
例外:
IllegalStateException - すでに接続されている場合
関連項目:
URLConnection.setDoInput(boolean)

setDoOutput

public void setDoOutput(boolean dooutput)
doOutput フィールドの値を、指定された値に設定します。

パラメータ:
dooutput - 新しい値
例外:
IllegalStateException - すでに接続されている場合
関連項目:
URLConnection.setDoOutput(boolean)

setIfModifiedSince

public void setIfModifiedSince(long ifmodifiedsince)
ifModifiedSince フィールド値を、指定された値に設定します。

パラメータ:
ifmodifiedsince - 新しい値
例外:
IllegalStateException - すでに接続されている場合
関連項目:
URLConnection.setIfModifiedSince(long)

setRequestProperty

public void setRequestProperty(String key,
                               String value)
リクエストプロパティを設定します。

パラメータ:
key - キー
value - 値
例外:
IllegalStateException - すでに接続されている場合
NullPointerException - キーが null の場合
関連項目:
URLConnection.setRequestProperty(String, String)

setUseCaches

public void setUseCaches(boolean usecaches)
useCaches フィールドを、指定された値に設定します。

パラメータ:
usecaches - 新しい値
例外:
IllegalStateException - すでに接続されている場合
関連項目:
URLConnection.setUseCaches(boolean)

toString

public String toString()
オブジェクトの文字列表現を返します。

戻り値:
文字列表現
関連項目:
Object.toString()

Kagetaka

Copyright (c) 2002-2004 The Kagetaka Project 'November 20, 2004'