public class URLConnect extends Object
| コンストラクタと説明 |
|---|
URLConnect(String url,
String pass)
コンストラクター
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
static String |
code2Message(int code)
HttpURLConnection のレスポンスコードに対応するメッセージ文字列を返します。
|
void |
connect()
指定のURLに対して、コネクトします。
|
void |
disconnect()
サーバへのほかの要求が今後発生しそうにないことを示します。
|
String |
getCharset()
キャラクタ 情報を取得します。
|
int |
getCode()
結果コード 情報(HttpURLConnection)を取得します。
|
protected URLConnection |
getConnection()
URL と ユーザー:パスワードを与えて、URLConnectionを返します。
|
long |
getDate()
作成日時 情報を取得します。
|
InputStream |
getInputStream()
接続先のデータの入力ストリームを取得します。
|
long |
getLength()
データ量 情報を取得します。
|
String |
getMessage()
メッセージ 情報(HttpURLConnection)を取得します。
|
String |
getMethod()
メソッド 情報(HttpURLConnection)を取得します。
|
long |
getModified()
更新日時 情報を取得します。
|
BufferedReader |
getReader()
接続先のデータのリーダーを取得します。
|
String |
getType()
タイプ 情報を取得します。
|
String |
getUrl()
URL 情報を取得します。
|
static void |
main(String[] args)
サンプル実行用のメインメソッド
java org.opengion.fukurou.util.URLConnect [<-info/-data>]
|
String |
readData()
U接続先のデータを取得します。
|
void |
setCharset(String chset)
キャラクタ 情報を設定します。
|
void |
setPostData(String data)
POSTするデータを設定します。
|
void |
setProxy(String host,
int port)
指定のURLに対して、コネクトするのに使用するプロキシ設定を行います。
|
public void setProxy(String host, int port)
host - 接続するプロキシのホスト名port - 接続するプロキシのポート番号public void connect()
throws IOException
IOException| 4.0.1.0 (2007/12/12) Postで複数キーを使えるように修正 |
| 5.1.6.0 (2010/05/01) charsetを指定できるようにする |
public String readData() throws IOException
IOExceptionpublic void disconnect()
protected URLConnection getConnection() throws IOException
IOExceptionpublic String getUrl()
| 4.3.4.4 (2009/01/01) メソッド名変更 |
public void setPostData(String data)
data - POSTデータ| 4.1.0.0 (2007/12/22) キーと値のセットを取得するよう変更 |
public String getType()
public long getLength()
public long getDate()
public long getModified()
public int getCode()
public String getMethod()
public String getMessage()
public String getCharset()
public void setCharset(String chset)
chset - キャラクタ 情報public BufferedReader getReader() throws IOException
IOExceptionpublic InputStream getInputStream() throws IOException
IOException| 5.4.2.0 (2011/12/01) 新規追加 |
public static String code2Message(int code)
code - HTTPレスポンスコードHttpURLConnection.HTTP_ACCEPTEDpublic static void main(String[] args) throws IOException
args - コマンド引数配列IOExceptionWebアプリケーションフレームワーク openGionCopyright (c) 2009 The openGion Project.