Package org.assertj.core.util
Class Paths
- java.lang.Object
-
- org.assertj.core.util.Paths
-
public class Paths extends java.lang.Object
Utility methods related toPath
s.- Since:
- 3.23.0
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Paths()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
checkArgumentCharsetIsSupported(java.lang.String charsetName)
static java.util.List<java.lang.String>
linesOf(java.nio.file.Path path, java.lang.String charsetName)
Loads the text content of a file at a given path into a list of strings, each string corresponding to a line.static java.util.List<java.lang.String>
linesOf(java.nio.file.Path path, java.nio.charset.Charset charset)
Loads the text content of a file at a given path into a list of strings, each string corresponding to a line.
-
-
-
Method Detail
-
linesOf
public static java.util.List<java.lang.String> linesOf(java.nio.file.Path path, java.nio.charset.Charset charset)
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:
java.lang.NullPointerException
- if the given charset isnull
.java.io.UncheckedIOException
- if an I/O exception occurs.
-
linesOf
public static java.util.List<java.lang.String> linesOf(java.nio.file.Path path, java.lang.String charsetName)
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:
java.lang.NullPointerException
- if the given charset isnull
.java.io.UncheckedIOException
- if an I/O exception occurs.
-
checkArgumentCharsetIsSupported
private static void checkArgumentCharsetIsSupported(java.lang.String charsetName)
-
-