Package org.assertj.core.util
Class URLs
java.lang.Object
org.assertj.core.util.URLs
Utility methods related to URLs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcheckArgumentCharsetIsSupported(String charsetName) static StringLoads the text content of a URL into a character string.static StringLoads the text content of a URL into a character string.Loads the text content of a URL into a list of strings, each string corresponding to a line.Loads the text content of a URL into a list of strings, each string corresponding to a line.private static StringloadContents(InputStream stream, Charset charset) loadLines(InputStream stream, Charset charset)
-
Constructor Details
-
URLs
private URLs()
-
-
Method Details
-
contentOf
Loads the text content of a URL into a character string.- Parameters:
url- the URL.charsetName- the name of the character set to use.- Returns:
- the content of the file.
- Throws:
IllegalArgumentException- if the given character set is not supported on this platform.UncheckedIOException- if an I/O exception occurs.
-
contentOf
Loads the text content of a URL into a character string.- Parameters:
url- the URL.charset- the character set to use.- Returns:
- the content of the URL.
- Throws:
NullPointerException- if the given charset isnull.UncheckedIOException- if an I/O exception occurs.
-
linesOf
Loads the text content of a URL into a list of strings, each string corresponding to a line. The line endings are either \n, \r or \r\n.- Parameters:
url- the URL.charset- the character set to use.- Returns:
- the content of the URL.
- Throws:
NullPointerException- if the given charset isnull.UncheckedIOException- if an I/O exception occurs.
-
linesOf
Loads the text content of a URL into a list of strings, each string corresponding to a line. The line endings are either \n, \r or \r\n.- Parameters:
url- the URL.charsetName- the name of the character set to use.- Returns:
- the content of the URL.
- Throws:
NullPointerException- if the given charset isnull.UncheckedIOException- if an I/O exception occurs.
-
loadContents
- Throws:
IOException
-
loadLines
- Throws:
IOException
-
checkArgumentCharsetIsSupported
-