/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charset the character set to use. * @return the content of the file. * @throws NullPointerException if the given charset is {@code null}. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, Charset charset) { return Files.contentOf(file, charset); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charset the character set to use. * @return the content of the file. * @throws NullPointerException if the given charset is {@code null}. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, Charset charset) { return Files.contentOf(file, charset); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charsetName the name of the character set to use. * @return the content of the file. * @throws IllegalArgumentException if the given character set is not supported on this platform. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, String charsetName) { return Files.contentOf(file, charsetName); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charset the character set to use. * @return the content of the file. * @throws NullPointerException if the given charset is {@code null}. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, Charset charset) { return Files.contentOf(file, charset); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charsetName the name of the character set to use. * @return the content of the file. * @throws IllegalArgumentException if the given character set is not supported on this platform. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, String charsetName) { return Files.contentOf(file, charsetName); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charsetName the name of the character set to use. * @return the content of the file. * @throws IllegalArgumentException if the given character set is not supported on this platform. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, String charsetName) { return Files.contentOf(file, charsetName); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charsetName the name of the character set to use. * @return the content of the file. * @throws IllegalArgumentException if the given character set is not supported on this platform. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, String charsetName) { return Files.contentOf(file, charsetName); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charset the character set to use. * @return the content of the file. * @throws NullPointerException if the given charset is {@code null}. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, Charset charset) { return Files.contentOf(file, charset); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charsetName the name of the character set to use. * @return the content of the file. * @throws IllegalArgumentException if the given character set is not supported on this platform. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, String charsetName) { return Files.contentOf(file, charsetName); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charset the character set to use. * @return the content of the file. * @throws NullPointerException if the given charset is {@code null}. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, Charset charset) { return Files.contentOf(file, charset); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param charsetName the name of the character set to use. * @return the content of the file. * @throws IllegalArgumentException if the given character set is not supported on this platform. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, String charsetName) { return Files.contentOf(file, charsetName); }
/** * Loads the text content of a file with the default character set, so that it can be passed to * {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @return the content of the file. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file) { return Files.contentOf(file, Charset.defaultCharset()); }
/** * Loads the text content of a file with the default character set, so that it can be passed to * {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @return the content of the file. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file) { return Files.contentOf(file, Charset.defaultCharset()); }
/** * Loads the text content of a file with the default character set, so that it can be passed to * {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @return the content of the file. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file) { return Files.contentOf(file, Charset.defaultCharset()); }
/** * Loads the text content of a file with the default character set, so that it can be passed to * {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @return the content of the file. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file) { return Files.contentOf(file, Charset.defaultCharset()); }
/** * Loads the text content of a file with the default character set, so that it can be passed to * {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @return the content of the file. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file) { return Files.contentOf(file, Charset.defaultCharset()); }
/** * Loads the text content of a file with the default character set, so that it can be passed to * {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @return the content of the file. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file) { return Files.contentOf(file, Charset.defaultCharset()); }
/** * Loads the text content of a file into a character string. * * @param file the file. * @param charsetName the name of the character set to use. * @return the content of the file. * @throws IllegalArgumentException if the given character set is not supported on this platform. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, String charsetName) { checkArgumentCharsetIsSupported(charsetName); return contentOf(file, Charset.forName(charsetName)); }
/** * Loads the text content of a file into a character string. * * @param file the file. * @param charsetName the name of the character set to use. * @return the content of the file. * @throws IllegalArgumentException if the given character set is not supported on this platform. * @throws UncheckedIOException if an I/O exception occurs. */ public static String contentOf(File file, String charsetName) { checkArgumentCharsetIsSupported(charsetName); return contentOf(file, Charset.forName(charsetName)); }
private String getNonAsciiAuthor() { return Files.contentOf(new File("test-resources/mediumtest/blameAuthor.txt"), StandardCharsets.UTF_8); }