Package org.assertj.core.util
Class Paths
java.lang.Object
org.assertj.core.util.Paths
Utility methods related to
Path
s.- Since:
- 3.23.0
- Author:
- Stefan Bratanov
-
Method Summary
Modifier and TypeMethodDescriptionLoads the text content of a file at a given path into a list of strings, each string corresponding to a line.Loads the text content of a file at a given path into a list of strings, each string corresponding to a line.
-
Method Details
-
linesOf
Loads the text content of a file at a given path into a list of strings, each string corresponding to a line. The line endings are either \n, \r or \r\n.- Parameters:
path
- the path.charset
- the character set to use.- Returns:
- the content of the file at the given path.
- Throws:
NullPointerException
- if the given charset isnull
.UncheckedIOException
- if an I/O exception occurs.
-
linesOf
Loads the text content of a file at a given path into a list of strings, each string corresponding to a line. The line endings are either \n, \r or \r\n.- Parameters:
path
- the path.charsetName
- the name of the character set to use.- Returns:
- the content of the file at the given path.
- Throws:
NullPointerException
- if the given charset isnull
.UncheckedIOException
- if an I/O exception occurs.
-