public class FNURLUtil
extends java.lang.Object
| Constructor and Description |
|---|
FNURLUtil() |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull java.net.HttpURLConnection |
getConnection(@NotNull java.net.URL url)
接続を確立する
|
static @NotNull java.net.HttpURLConnection |
getConnection(@NotNull java.net.URL url,
@NotNull java.util.Map<java.lang.String,java.lang.String> headers)
接続を確立する
|
static @NotNull java.lang.String |
getResponse(@NotNull java.net.URL url)
文字列を取る
|
static @NotNull java.util.concurrent.CompletableFuture<java.lang.String> |
getResponseAsync(@NotNull java.net.URL url)
非同期で文字列を取得
失敗時はnullを返す
|
static java.util.concurrent.CompletableFuture<java.lang.Void> |
getResponseAsync(java.net.URL url,
java.util.function.Consumer<java.lang.String> stringConsumer)
Deprecated.
|
static @NotNull PostResponse |
getResponseByPOST(@NotNull java.net.URL url,
byte[] body,
@NotNull java.util.Map<java.lang.String,java.lang.String> headers)
POSTでデータを送信
|
static @NotNull PostResponse |
getResponseByPOST(@NotNull java.net.URL url,
@NotNull PostRequest request)
POSTでデータを送信
|
static @NotNull PostResponse |
getResponseByPOST(@NotNull java.net.URL url,
@NotNull java.lang.String body,
@NotNull java.lang.String language,
@NotNull java.lang.String contentType)
POSTでテキストを送り返ってきた文字列とステータスコードを取得
|
static @NotNull java.util.concurrent.CompletableFuture<PostResponse> |
getResponseByPOSTAsync(@NotNull java.net.URL url,
@NotNull java.lang.String body,
@NotNull java.lang.String language,
@NotNull java.lang.String contentType)
非同期でPOSTでテキストを送り返ってきた文字列とステータスコードを取得
失敗時はnullを返す
|
static java.util.concurrent.CompletableFuture<java.lang.Void> |
getResponseByPOSTAsync(java.net.URL url,
java.lang.String body,
java.lang.String language,
java.lang.String contentType,
java.util.function.Consumer<PostResponse> responseConsumer)
Deprecated.
|
static @NotNull java.io.InputStream |
getStream(@NotNull java.net.URL url)
ストリームを取る
|
static @NotNull java.util.concurrent.CompletableFuture<java.io.InputStream> |
getStreamAsync(@NotNull java.net.URL url)
非同期でストリームを取得
失敗時はnullを返す
|
static java.util.concurrent.CompletableFuture<java.lang.Void> |
getStreamAsync(java.net.URL url,
java.util.function.Consumer<java.io.InputStream> streamConsumer)
Deprecated.
|
static @NotNull java.lang.String |
getUserAgent()
ユーザエージェント取得
|
static @Nullable java.net.URL |
newURL(@Nullable java.lang.String url)
例外なし new URL
|
@Nullable
public static @Nullable java.net.URL newURL(@Nullable
@Nullable java.lang.String url)
url - url@NotNull public static @NotNull java.lang.String getUserAgent()
@NotNull
public static @NotNull java.net.HttpURLConnection getConnection(@NotNull
@NotNull java.net.URL url,
@NotNull
@NotNull java.util.Map<java.lang.String,java.lang.String> headers)
throws java.io.IOException
url - URLheaders - ヘッダーjava.io.IOException - 接続失敗@NotNull
public static @NotNull java.net.HttpURLConnection getConnection(@NotNull
@NotNull java.net.URL url)
throws java.io.IOException
url - URLjava.io.IOException - 接続失敗@NotNull
public static @NotNull java.io.InputStream getStream(@NotNull
@NotNull java.net.URL url)
throws java.io.IOException
url - URLjava.io.IOException - 接続失敗@NotNull
public static @NotNull java.lang.String getResponse(@NotNull
@NotNull java.net.URL url)
throws java.io.IOException
url - URLjava.io.IOException - 接続失敗@Deprecated
public static java.util.concurrent.CompletableFuture<java.lang.Void> getStreamAsync(java.net.URL url,
java.util.function.Consumer<java.io.InputStream> streamConsumer)
getStreamAsync(URL)に移行してくださいurl - URLstreamConsumer - ストリーム@NotNull
public static @NotNull java.util.concurrent.CompletableFuture<java.io.InputStream> getStreamAsync(@NotNull
@NotNull java.net.URL url)
url - URL@Deprecated
public static java.util.concurrent.CompletableFuture<java.lang.Void> getResponseAsync(java.net.URL url,
java.util.function.Consumer<java.lang.String> stringConsumer)
getResponseAsync(URL)に移行してくださいurl - URLstringConsumer - 文字列@NotNull
public static @NotNull java.util.concurrent.CompletableFuture<java.lang.String> getResponseAsync(@NotNull
@NotNull java.net.URL url)
url - URL@Deprecated
public static java.util.concurrent.CompletableFuture<java.lang.Void> getResponseByPOSTAsync(java.net.URL url,
java.lang.String body,
java.lang.String language,
java.lang.String contentType,
java.util.function.Consumer<PostResponse> responseConsumer)
getResponseByPOSTAsync(URL, String, String, String)に移行してくださいurl - URLbody - テキストlanguage - 言語contentType - typeresponseConsumer - 返答とステータスコードのペア@NotNull public static @NotNull java.util.concurrent.CompletableFuture<PostResponse> getResponseByPOSTAsync(@NotNull @NotNull java.net.URL url, @NotNull @NotNull java.lang.String body, @NotNull @NotNull java.lang.String language, @NotNull @NotNull java.lang.String contentType)
url - URLbody - テキストlanguage - 言語contentType - type@NotNull public static @NotNull PostResponse getResponseByPOST(@NotNull @NotNull java.net.URL url, @NotNull @NotNull java.lang.String body, @NotNull @NotNull java.lang.String language, @NotNull @NotNull java.lang.String contentType) throws java.io.IOException
url - URLbody - テキストlanguage - 言語contentType - typejava.io.IOException - 例外@NotNull public static @NotNull PostResponse getResponseByPOST(@NotNull @NotNull java.net.URL url, byte[] body, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> headers) throws java.io.IOException
url - URLbody - 本体headers - ヘッダーjava.io.IOException - 例外@NotNull public static @NotNull PostResponse getResponseByPOST(@NotNull @NotNull java.net.URL url, @NotNull @NotNull PostRequest request) throws java.io.IOException
url - URLrequest - リクエストjava.io.IOException - 例外