Package org.assertj.core.util
Class URLs
java.lang.Object
org.assertj.core.util.URLs
Utility methods related to URLs.
- Author:
- Turbo87, dorzey
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Loads the text content of a URL into a character string.static String
Loads 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.
-
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.
-