public class URLs
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
URLs() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
checkArgumentCharsetIsSupported(java.lang.String charsetName) |
static java.lang.String |
contentOf(java.net.URL url,
java.nio.charset.Charset charset)
Loads the text content of a URL into a character string.
|
static java.lang.String |
contentOf(java.net.URL url,
java.lang.String charsetName)
Loads the text content of a URL into a character string.
|
static java.util.List<java.lang.String> |
linesOf(java.net.URL url,
java.nio.charset.Charset charset)
Loads the text content of a URL into a list of strings, each string corresponding to a line.
|
static java.util.List<java.lang.String> |
linesOf(java.net.URL url,
java.lang.String charsetName)
Loads the text content of a URL into a list of strings, each string corresponding to a line.
|
private static java.lang.String |
loadContents(java.io.InputStream stream,
java.nio.charset.Charset charset) |
private static java.util.List<java.lang.String> |
loadLines(java.io.InputStream stream,
java.nio.charset.Charset charset) |
public static java.lang.String contentOf(java.net.URL url,
java.lang.String charsetName)
url - the URL.charsetName - the name of the character set to use.java.lang.IllegalArgumentException - if the given character set is not supported on this platform.RuntimeIOException - if an I/O exception occurs.public static java.lang.String contentOf(java.net.URL url,
java.nio.charset.Charset charset)
url - the URL.charset - the character set to use.java.lang.NullPointerException - if the given charset is null.RuntimeIOException - if an I/O exception occurs.public static java.util.List<java.lang.String> linesOf(java.net.URL url,
java.nio.charset.Charset charset)
url - the URL.charset - the character set to use.java.lang.NullPointerException - if the given charset is null.RuntimeIOException - if an I/O exception occurs.public static java.util.List<java.lang.String> linesOf(java.net.URL url,
java.lang.String charsetName)
url - the URL.charsetName - the name of the character set to use.java.lang.NullPointerException - if the given charset is null.RuntimeIOException - if an I/O exception occurs.private static java.lang.String loadContents(java.io.InputStream stream,
java.nio.charset.Charset charset)
throws java.io.IOException
java.io.IOExceptionprivate static java.util.List<java.lang.String> loadLines(java.io.InputStream stream,
java.nio.charset.Charset charset)
throws java.io.IOException
java.io.IOExceptionprivate static void checkArgumentCharsetIsSupported(java.lang.String charsetName)