Repository: assertj/assertj (Java)

Issue:
Replace RuntimeIOException with UncheckedIOException?
Should we replace the AssertJ specific `RuntimeIOException` with `UncheckedIOException` which was added in Java 8?


Hints:
I can work on this 👍 
@joel-costigliola  what should we do with the missing constructors in UncheckedIOException?
e.g. RuntimeIOException(String message)

UncheckedIOException Constructors:

UncheckedIOException(IOException cause)
UncheckedIOException(String message, IOException cause)

can't we use `UncheckedIOException(String message, IOException cause)` ? 
if not it means it wasn't an IOException in the first place, then a simple `RuntimeException` should do the job
Yes, you are right. Will fix wrong usage of RuntimeIOException with RuntimeException. Thanks!

Patch:
diff --git a/src/main/java/org/assertj/core/api/AbstractFileAssert.java b/src/main/java/org/assertj/core/api/AbstractFileAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractFileAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractFileAssert.java
@@ -16,8 +16,8 @@
 import static org.assertj.core.util.Preconditions.checkNotNull;
 
 import java.io.File;
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.Files;
 import org.assertj.core.util.CheckReturnValue;
 import org.assertj.core.util.VisibleForTesting;
@@ -228,7 +228,7 @@ public SELF isRelative() {
    * @throws IllegalArgumentException if the given {@code File} is not an existing file.
    * @throws AssertionError if the actual {@code File} is {@code null}.
    * @throws AssertionError if the actual {@code File} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the content of the actual {@code File} is not equal to the content of the given one.
    *
    * @deprecated use {@link #hasSameContentAs(File)} instead
@@ -266,7 +266,7 @@ public SELF hasContentEqualTo(File expected) {
    * @throws IllegalArgumentException if the given {@code File} is not an existing file.
    * @throws AssertionError if the actual {@code File} is {@code null}.
    * @throws AssertionError if the actual {@code File} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the content of the actual {@code File} is not equal to the content of the given one.
    */
   public SELF hasSameContentAs(File expected) {
@@ -298,7 +298,7 @@ public SELF hasSameContentAs(File expected) {
    * @throws IllegalArgumentException if the given {@code File} is not an existing file.
    * @throws AssertionError if the actual {@code File} is {@code null}.
    * @throws AssertionError if the actual {@code File} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the content of the actual {@code File} is not equal to the content of the given one.
    */
   public SELF hasSameContentAs(File expected, Charset expectedCharset) {
@@ -325,7 +325,7 @@ public SELF hasSameContentAs(File expected, Charset expectedCharset) {
    * @throws NullPointerException if the given content is {@code null}.
    * @throws AssertionError if the actual {@code File} is {@code null}.
    * @throws AssertionError if the actual {@code File} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the content of the actual {@code File} is not equal to the given binary content.
    */
   public SELF hasBinaryContent(byte[] expected) {
@@ -391,7 +391,7 @@ public SELF usingCharset(Charset charset) {
    * @throws NullPointerException if the given content is {@code null}.
    * @throws AssertionError if the actual {@code File} is {@code null}.
    * @throws AssertionError if the actual {@code File} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the content of the actual {@code File} is not equal to the given content.
    */
   public SELF hasContent(String expected) {
@@ -469,7 +469,7 @@ public SELF canRead() {
    * @param expected the expected parent {@code File}.
    * @return {@code this} assertion object.
    * @throws NullPointerException if the expected parent {@code File} is {@code null}.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the actual {@code File} is {@code null}.
    * @throws AssertionError if the actual {@code File} parent is not equal to the expected one.
    * 
diff --git a/src/main/java/org/assertj/core/api/AbstractPathAssert.java b/src/main/java/org/assertj/core/api/AbstractPathAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractPathAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractPathAssert.java
@@ -15,6 +15,7 @@
 import static org.assertj.core.util.Preconditions.checkArgument;
 import static org.assertj.core.util.Preconditions.checkNotNull;
 
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
 import java.nio.file.ClosedFileSystemException;
 import java.nio.file.FileSystem;
@@ -25,7 +26,6 @@
 import java.nio.file.spi.FileSystemProvider;
 
 import org.assertj.core.api.exception.PathsException;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.Paths;
 import org.assertj.core.util.CheckReturnValue;
 import org.assertj.core.util.VisibleForTesting;
@@ -181,7 +181,7 @@ public SELF hasSameContentAs(Path expected, Charset expectedCharset) {
    * @throws NullPointerException if the given content is {@code null}.
    * @throws AssertionError if the actual {@code File} is {@code null}.
    * @throws AssertionError if the actual {@code File} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the content of the actual {@code File} is not equal to the given binary content.
    */
   public SELF hasBinaryContent(byte[] expected) {
@@ -261,7 +261,7 @@ public SELF usingCharset(Charset charset) {
    * @param expected the expected text content to compare the actual {@code File}'s content to.
    * @return {@code this} assertion object.
    * @throws NullPointerException if the given content is {@code null}.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the actual {@code Path} is {@code null}.
    * @throws AssertionError if the actual {@code Path} is not a {@link Files#isReadable(Path) readable} file.
    * @throws AssertionError if the content of the actual {@code File} is not equal to the given content.
diff --git a/src/main/java/org/assertj/core/api/Assertions.java b/src/main/java/org/assertj/core/api/Assertions.java
--- a/src/main/java/org/assertj/core/api/Assertions.java
+++ b/src/main/java/org/assertj/core/api/Assertions.java
@@ -18,6 +18,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.UncheckedIOException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.URI;
@@ -68,7 +69,6 @@
 import java.util.stream.Stream;
 
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.api.filter.FilterOperator;
 import org.assertj.core.api.filter.Filters;
 import org.assertj.core.api.filter.InFilter;
@@ -2206,7 +2206,7 @@ public static NotFilter not(Object valueNotToMatch) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file, Charset charset) {
     return Files.contentOf(file, charset);
@@ -2223,7 +2223,7 @@ public static String contentOf(File file, Charset charset) {
    * @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 RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file, String charsetName) {
     return Files.contentOf(file, charsetName);
@@ -2239,7 +2239,7 @@ public static String contentOf(File file, String charsetName) {
    *
    * @param file the file.
    * @return the content of the file.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file) {
     return Files.contentOf(file, Charset.defaultCharset());
@@ -2253,7 +2253,7 @@ public static String contentOf(File file) {
    * @param file the file.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file) {
     return Files.linesOf(file, Charset.defaultCharset());
@@ -2267,7 +2267,7 @@ public static List<String> linesOf(File file) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file, Charset charset) {
     return Files.linesOf(file, charset);
@@ -2281,7 +2281,7 @@ public static List<String> linesOf(File file, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file, String charsetName) {
     return Files.linesOf(file, charsetName);
@@ -2301,7 +2301,7 @@ public static List<String> linesOf(File file, String charsetName) {
    * @param charset the character set to use.
    * @return the content of the URL.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url, Charset charset) {
     return URLs.contentOf(url, charset);
@@ -2317,7 +2317,7 @@ public static String contentOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the URL.
    * @throws IllegalArgumentException if the given character set is not supported on this platform.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url, String charsetName) {
     return URLs.contentOf(url, charsetName);
@@ -2332,7 +2332,7 @@ public static String contentOf(URL url, String charsetName) {
    *
    * @param url the URL.
    * @return the content of the file.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url) {
     return URLs.contentOf(url, Charset.defaultCharset());
@@ -2346,7 +2346,7 @@ public static String contentOf(URL url) {
    * @param url the URL.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url) {
     return URLs.linesOf(url, Charset.defaultCharset());
@@ -2360,7 +2360,7 @@ public static List<String> linesOf(URL url) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url, Charset charset) {
     return URLs.linesOf(url, charset);
@@ -2374,7 +2374,7 @@ public static List<String> linesOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url, String charsetName) {
     return URLs.linesOf(url, charsetName);
diff --git a/src/main/java/org/assertj/core/api/AssertionsForClassTypes.java b/src/main/java/org/assertj/core/api/AssertionsForClassTypes.java
--- a/src/main/java/org/assertj/core/api/AssertionsForClassTypes.java
+++ b/src/main/java/org/assertj/core/api/AssertionsForClassTypes.java
@@ -16,6 +16,7 @@
 
 import java.io.File;
 import java.io.InputStream;
+import java.io.UncheckedIOException;
 import java.math.BigDecimal;
 import java.net.URI;
 import java.net.URL;
@@ -38,7 +39,6 @@
 import java.util.concurrent.CompletableFuture;
 
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.api.filter.FilterOperator;
 import org.assertj.core.api.filter.Filters;
 import org.assertj.core.api.filter.InFilter;
@@ -1444,7 +1444,7 @@ public static NotFilter not(Object valueNotToMatch) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file, Charset charset) {
     return Files.contentOf(file, charset);
@@ -1461,7 +1461,7 @@ public static String contentOf(File file, Charset charset) {
    * @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 RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file, String charsetName) {
     return Files.contentOf(file, charsetName);
@@ -1477,7 +1477,7 @@ public static String contentOf(File file, String charsetName) {
    *
    * @param file the file.
    * @return the content of the file.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file) {
     return Files.contentOf(file, Charset.defaultCharset());
@@ -1491,7 +1491,7 @@ public static String contentOf(File file) {
    * @param file the file.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file) {
     return Files.linesOf(file, Charset.defaultCharset());
@@ -1505,7 +1505,7 @@ public static List<String> linesOf(File file) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file, Charset charset) {
     return Files.linesOf(file, charset);
@@ -1519,7 +1519,7 @@ public static List<String> linesOf(File file, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file, String charsetName) {
     return Files.linesOf(file, charsetName);
@@ -1539,7 +1539,7 @@ public static List<String> linesOf(File file, String charsetName) {
    * @param charset the character set to use.
    * @return the content of the URL.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url, Charset charset) {
     return URLs.contentOf(url, charset);
@@ -1555,7 +1555,7 @@ public static String contentOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the URL.
    * @throws IllegalArgumentException if the given character set is not supported on this platform.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url, String charsetName) {
     return URLs.contentOf(url, charsetName);
@@ -1570,7 +1570,7 @@ public static String contentOf(URL url, String charsetName) {
    *
    * @param url the URL.
    * @return the content of the file.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url) {
     return URLs.contentOf(url, Charset.defaultCharset());
@@ -1584,7 +1584,7 @@ public static String contentOf(URL url) {
    * @param url the URL.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url) {
     return URLs.linesOf(url, Charset.defaultCharset());
@@ -1598,7 +1598,7 @@ public static List<String> linesOf(URL url) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url, Charset charset) {
     return URLs.linesOf(url, charset);
@@ -1612,7 +1612,7 @@ public static List<String> linesOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url, String charsetName) {
     return URLs.linesOf(url, charsetName);
diff --git a/src/main/java/org/assertj/core/api/Java6Assertions.java b/src/main/java/org/assertj/core/api/Java6Assertions.java
--- a/src/main/java/org/assertj/core/api/Java6Assertions.java
+++ b/src/main/java/org/assertj/core/api/Java6Assertions.java
@@ -16,6 +16,7 @@
 
 import java.io.File;
 import java.io.InputStream;
+import java.io.UncheckedIOException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.URI;
@@ -42,7 +43,6 @@
 import java.util.concurrent.atomic.AtomicStampedReference;
 
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.api.filter.FilterOperator;
 import org.assertj.core.api.filter.Filters;
 import org.assertj.core.api.filter.InFilter;
@@ -1972,7 +1972,7 @@ public static NotFilter not(Object valueNotToMatch) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file, Charset charset) {
     return Files.contentOf(file, charset);
@@ -1989,7 +1989,7 @@ public static String contentOf(File file, Charset charset) {
    * @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 RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file, String charsetName) {
     return Files.contentOf(file, charsetName);
@@ -2005,7 +2005,7 @@ public static String contentOf(File file, String charsetName) {
    *
    * @param file the file.
    * @return the content of the file.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file) {
     return Files.contentOf(file, Charset.defaultCharset());
@@ -2019,7 +2019,7 @@ public static String contentOf(File file) {
    * @param file the file.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file) {
     return Files.linesOf(file, Charset.defaultCharset());
@@ -2033,7 +2033,7 @@ public static List<String> linesOf(File file) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file, Charset charset) {
     return Files.linesOf(file, charset);
@@ -2047,7 +2047,7 @@ public static List<String> linesOf(File file, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file, String charsetName) {
     return Files.linesOf(file, charsetName);
@@ -2067,7 +2067,7 @@ public static List<String> linesOf(File file, String charsetName) {
    * @param charset the character set to use.
    * @return the content of the URL.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url, Charset charset) {
     return URLs.contentOf(url, charset);
@@ -2083,7 +2083,7 @@ public static String contentOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the URL.
    * @throws IllegalArgumentException if the given character set is not supported on this platform.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url, String charsetName) {
     return URLs.contentOf(url, charsetName);
@@ -2098,7 +2098,7 @@ public static String contentOf(URL url, String charsetName) {
    *
    * @param url the URL.
    * @return the content of the file.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url) {
     return URLs.contentOf(url, Charset.defaultCharset());
@@ -2112,7 +2112,7 @@ public static String contentOf(URL url) {
    * @param url the URL.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url) {
     return URLs.linesOf(url, Charset.defaultCharset());
@@ -2126,7 +2126,7 @@ public static List<String> linesOf(URL url) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url, Charset charset) {
     return URLs.linesOf(url, charset);
@@ -2140,7 +2140,7 @@ public static List<String> linesOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url, String charsetName) {
     return URLs.linesOf(url, charsetName);
diff --git a/src/main/java/org/assertj/core/api/WithAssertions.java b/src/main/java/org/assertj/core/api/WithAssertions.java
--- a/src/main/java/org/assertj/core/api/WithAssertions.java
+++ b/src/main/java/org/assertj/core/api/WithAssertions.java
@@ -15,6 +15,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.UncheckedIOException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.URI;
@@ -65,7 +66,6 @@
 import java.util.stream.Stream;
 
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.api.filter.FilterOperator;
 import org.assertj.core.api.filter.Filters;
 import org.assertj.core.api.filter.InFilter;
@@ -1638,7 +1638,7 @@ default <T> DoesNotHave<T> doesNotHave(final Condition<? super T> condition) {
    * @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 RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   default String contentOf(final File file, final String charsetName) {
     return Assertions.contentOf(file, charsetName);
@@ -1654,7 +1654,7 @@ default String contentOf(final File file, final String charsetName) {
    *
    * @param file the file.
    * @return the content of the file.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   default String contentOf(final File file) {
     return Assertions.contentOf(file);
@@ -1671,7 +1671,7 @@ default String contentOf(final File file) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   default String contentOf(final File file, final Charset charset) {
     return Assertions.contentOf(file, charset);
@@ -1685,7 +1685,7 @@ default String contentOf(final File file, final Charset charset) {
    * @param file the file.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   default List<String> linesOf(final File file) {
     return Assertions.linesOf(file);
@@ -1699,7 +1699,7 @@ default List<String> linesOf(final File file) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   default List<String> linesOf(final File file, final String charsetName) {
     return Assertions.linesOf(file, charsetName);
@@ -1713,7 +1713,7 @@ default List<String> linesOf(final File file, final String charsetName) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   default List<String> linesOf(final File file, final Charset charset) {
     return Assertions.linesOf(file, charset);
@@ -2596,7 +2596,7 @@ default NotFilter not(Object valueNotToMatch) {
    * @param charset the character set to use.
    * @return the content of the URL.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    * @since 3.9.0
    */
   default String contentOf(URL url, Charset charset) {
@@ -2613,7 +2613,7 @@ default String contentOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the URL.
    * @throws IllegalArgumentException if the given character set is not supported on this platform.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    * @since 3.9.0
    */
   default String contentOf(URL url, String charsetName) {
@@ -2629,7 +2629,7 @@ default String contentOf(URL url, String charsetName) {
    *
    * @param url the URL.
    * @return the content of the file.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    * @since 3.9.0
    */
   default String contentOf(URL url) {
@@ -2644,7 +2644,7 @@ default String contentOf(URL url) {
    * @param url the URL.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    * @since 3.9.0
    */
   default List<String> linesOf(URL url) {
@@ -2659,7 +2659,7 @@ default List<String> linesOf(URL url) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    * @since 3.9.0
    */
   default List<String> linesOf(URL url, Charset charset) {
@@ -2674,7 +2674,7 @@ default List<String> linesOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    * @since 3.9.0
    */
   default List<String> linesOf(URL url, String charsetName) {
diff --git a/src/main/java/org/assertj/core/api/exception/RuntimeIOException.java b/src/main/java/org/assertj/core/api/exception/RuntimeIOException.java
deleted file mode 100644
--- a/src/main/java/org/assertj/core/api/exception/RuntimeIOException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- *
- * Copyright 2012-2018 the original author or authors.
- */
-package org.assertj.core.api.exception;
-
-import org.assertj.core.util.Files;
-import org.assertj.core.util.URLs;
-
-/**
- * Exception thrown by <code>{@link Files}</code> and <code>{@link URLs}</code>.
- * 
- * @author Yvonne Wang
- */
-public final class RuntimeIOException extends RuntimeException {
-
-  private static final long serialVersionUID = -8328554403430790831L;
-
-  /**
-   * Creates a new {@link RuntimeIOException}.
-   * 
-   * @param message the detail message.
-   */
-  public RuntimeIOException(String message) {
-    super(message);
-  }
-
-  /**
-   * Creates a new {@link RuntimeIOException}.
-   * 
-   * @param message the detail message.
-   * @param cause the cause of the error.
-   */
-  public RuntimeIOException(String message, Throwable cause) {
-    super(message, cause);
-  }
-}
diff --git a/src/main/java/org/assertj/core/internal/Files.java b/src/main/java/org/assertj/core/internal/Files.java
--- a/src/main/java/org/assertj/core/internal/Files.java
+++ b/src/main/java/org/assertj/core/internal/Files.java
@@ -35,12 +35,12 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
 import java.nio.charset.MalformedInputException;
 import java.util.List;
 
 import org.assertj.core.api.AssertionInfo;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.util.VisibleForTesting;
 import org.assertj.core.util.diff.Delta;
 
@@ -88,7 +88,7 @@ public static Files instance() {
    * @throws IllegalArgumentException if {@code expected} is not an existing file.
    * @throws AssertionError if {@code actual} is {@code null}.
    * @throws AssertionError if {@code actual} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the given files do not have same content.
    */
   public void assertSameContentAs(AssertionInfo info, File actual, Charset actualCharset, File expected,
@@ -105,15 +105,15 @@ public void assertSameContentAs(AssertionInfo info, File actual, Charset actualC
         // compute a binary diff, if there is a binary diff, it it shows the offset of the malformed input
         BinaryDiffResult binaryDiffResult = binaryDiff.diff(actual, readAllBytes(expected.toPath()));
         if (binaryDiffResult.hasNoDiff()) {
-          // fall back to the RuntimeIOException : not throwing an error is wrong as there was one in the first place.
+          // fall back to the UncheckedIOException : not throwing an error is wrong as there was one in the first place.
           throw e;
         }
         throw failures.failure(info, shouldHaveBinaryContent(actual, binaryDiffResult));
       } catch (IOException ioe) {
-        throw new RuntimeIOException(format(UNABLE_TO_COMPARE_FILE_CONTENTS, actual, expected), ioe);
+        throw new UncheckedIOException(format(UNABLE_TO_COMPARE_FILE_CONTENTS, actual, expected), ioe);
       }
     } catch (IOException e) {
-      throw new RuntimeIOException(format(UNABLE_TO_COMPARE_FILE_CONTENTS, actual, expected), e);
+      throw new UncheckedIOException(format(UNABLE_TO_COMPARE_FILE_CONTENTS, actual, expected), e);
     }
   }
 
@@ -125,7 +125,7 @@ public void assertSameContentAs(AssertionInfo info, File actual, Charset actualC
    * @throws NullPointerException if {@code expected} is {@code null}.
    * @throws AssertionError if {@code actual} is {@code null}.
    * @throws AssertionError if {@code actual} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the file does not have the binary content.
    */
   public void assertHasBinaryContent(AssertionInfo info, File actual, byte[] expected) {
@@ -137,7 +137,7 @@ public void assertHasBinaryContent(AssertionInfo info, File actual, byte[] expec
       throw failures.failure(info, shouldHaveBinaryContent(actual, result));
     } catch (IOException e) {
       String msg = String.format("Unable to verify binary contents of file:<%s>", actual);
-      throw new RuntimeIOException(msg, e);
+      throw new UncheckedIOException(msg, e);
     }
   }
 
@@ -150,7 +150,7 @@ public void assertHasBinaryContent(AssertionInfo info, File actual, byte[] expec
    * @throws NullPointerException if {@code expected} is {@code null}.
    * @throws AssertionError if {@code actual} is {@code null}.
    * @throws AssertionError if {@code actual} is not an existing file.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the file does not have the text content.
    */
   public void assertHasContent(AssertionInfo info, File actual, String expected, Charset charset) {
@@ -162,7 +162,7 @@ public void assertHasContent(AssertionInfo info, File actual, String expected, C
       throw failures.failure(info, shouldHaveContent(actual, charset, diffs));
     } catch (IOException e) {
       String msg = String.format("Unable to verify text contents of file:<%s>", actual);
-      throw new RuntimeIOException(msg, e);
+      throw new UncheckedIOException(msg, e);
     }
   }
 
@@ -285,7 +285,7 @@ public void assertCanRead(AssertionInfo info, File actual) {
    * @param actual the given file.
    * @param expected the expected parent {@code File}.
    * @throws NullPointerException if the expected parent {@code File} is {@code null}.
-   * @throws RuntimeIOException if an I/O error occurs.
+   * @throws UncheckedIOException if an I/O error occurs.
    * @throws AssertionError if the given {@code File} is {@code null}.
    * @throws AssertionError if the given {@code File} does not have a parent.
    * @throws AssertionError if the given {@code File} parent is not equal to the expected one.
@@ -298,7 +298,7 @@ public void assertHasParent(AssertionInfo info, File actual, File expected) {
           && areEqual(expected.getCanonicalFile(), actual.getParentFile().getCanonicalFile()))
         return;
     } catch (IOException e) {
-      throw new RuntimeIOException(String.format("Unable to get canonical form of [%s] or [%s].", actual, expected), e);
+      throw new UncheckedIOException(String.format("Unable to get canonical form of [%s] or [%s].", actual, expected), e);
     }
     throw failures.failure(info, shouldHaveParent(actual, expected));
   }
diff --git a/src/main/java/org/assertj/core/internal/Paths.java b/src/main/java/org/assertj/core/internal/Paths.java
--- a/src/main/java/org/assertj/core/internal/Paths.java
+++ b/src/main/java/org/assertj/core/internal/Paths.java
@@ -38,6 +38,7 @@
 import static org.assertj.core.util.Preconditions.checkNotNull;
 
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
 import java.nio.file.LinkOption;
 import java.nio.file.Path;
@@ -45,7 +46,6 @@
 
 import org.assertj.core.api.AssertionInfo;
 import org.assertj.core.api.exception.PathsException;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.util.VisibleForTesting;
 import org.assertj.core.util.diff.Delta;
 
@@ -280,7 +280,7 @@ public void assertHasContent(final AssertionInfo info, Path actual, String expec
 	  if (diffs.isEmpty()) return;
 	  throw failures.failure(info, shouldHaveContent(actual, charset, diffs));
 	} catch (IOException e) {
-	  throw new RuntimeIOException(format("Unable to verify text contents of path:<%s>", actual), e);
+	  throw new UncheckedIOException(format("Unable to verify text contents of path:<%s>", actual), e);
 	}
   }
 
@@ -292,7 +292,7 @@ public void assertHasBinaryContent(AssertionInfo info, Path actual, byte[] expec
 	  if (diffResult.hasNoDiff()) return;
 	  throw failures.failure(info, shouldHaveBinaryContent(actual, diffResult));
 	} catch (IOException e) {
-	  throw new RuntimeIOException(format("Unable to verify binary contents of path:<%s>", actual), e);
+	  throw new UncheckedIOException(format("Unable to verify binary contents of path:<%s>", actual), e);
 	}
   }
 
@@ -305,7 +305,7 @@ public void assertHasSameContentAs(AssertionInfo info, Path actual, Charset actu
 	  if (diffs.isEmpty()) return;
 	  throw failures.failure(info, shouldHaveSameContent(actual, expected, diffs));
 	} catch (IOException e) {
-	  throw new RuntimeIOException(format("Unable to compare contents of paths:<%s> and:<%s>", actual, expected), e);
+	  throw new UncheckedIOException(format("Unable to compare contents of paths:<%s> and:<%s>", actual, expected), e);
 	}
   }
 
diff --git a/src/main/java/org/assertj/core/util/Files.java b/src/main/java/org/assertj/core/util/Files.java
--- a/src/main/java/org/assertj/core/util/Files.java
+++ b/src/main/java/org/assertj/core/util/Files.java
@@ -26,13 +26,12 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.StringWriter;
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 
-import org.assertj.core.api.exception.RuntimeIOException;
-
 /**
  * Utility methods related to files.
  * 
@@ -86,12 +85,12 @@ private static List<String> fileNamesIn(File dir, boolean recurse) {
    * Returns the system's temporary directory.
    * 
    * @return the system's temporary directory.
-   * @throws RuntimeIOException if this method cannot find or create the system's temporary directory.
+   * @throws RuntimeException if this method cannot find or create the system's temporary directory.
    */
   public static File temporaryFolder() {
     File temp = new File(temporaryFolderPath());
     if (!temp.isDirectory()) {
-      throw new RuntimeIOException("Unable to find temporary directory");
+      throw new RuntimeException("Unable to find temporary directory");
     }
     return temp;
   }
@@ -133,9 +132,9 @@ public static File newTemporaryFolder() {
    * 
    * @param path the path of the new file.
    * @return the new created file.
-   * @throws RuntimeIOException if the path belongs to an existing non-empty directory.
-   * @throws RuntimeIOException if the path belongs to an existing file.
-   * @throws RuntimeIOException if any I/O error is thrown when creating the new file.
+   * @throws RuntimeException if the path belongs to an existing non-empty directory.
+   * @throws RuntimeException if the path belongs to an existing file.
+   * @throws UncheckedIOException if any I/O error is thrown when creating the new file.
    */
   public static File newFile(String path) {
     File file = createFileIfPathIsNotANonEmptyDirectory(path);
@@ -154,9 +153,9 @@ public static File newFile(String path) {
    * 
    * @param path the path of the new directory.
    * @return the new created directory.
-   * @throws RuntimeIOException if the path belongs to an existing non-empty directory.
-   * @throws RuntimeIOException if the path belongs to an existing file.
-   * @throws RuntimeIOException if any I/O error is thrown when creating the new directory.
+   * @throws RuntimeException if the path belongs to an existing non-empty directory.
+   * @throws RuntimeException if the path belongs to an existing file.
+   * @throws RuntimeException if any I/O error is thrown when creating the new directory.
    */
   public static File newFolder(String path) {
     File file = createFileIfPathIsNotANonEmptyDirectory(path);
@@ -178,36 +177,39 @@ private static File createFileIfPathIsNotANonEmptyDirectory(String path) {
     return file;
   }
 
-  private static RuntimeIOException cannotCreateNewFile(String path, String reason) {
+  private static UncheckedIOException cannotCreateNewFile(String path, String reason) {
     throw cannotCreateNewFile(path, reason, null);
   }
 
-  private static RuntimeIOException cannotCreateNewFile(String path, Exception cause) {
+  private static UncheckedIOException cannotCreateNewFile(String path, Exception cause) {
     throw cannotCreateNewFile(path, null, cause);
   }
 
-  private static RuntimeIOException cannotCreateNewFile(String path, String reason, Exception cause) {
+  private static UncheckedIOException cannotCreateNewFile(String path, String reason, Exception cause) {
     String message = String.format("Unable to create the new file %s", quote(path));
     if (!Strings.isNullOrEmpty(reason)) {
       message = concat(message, ": ", reason);
     }
-    if (cause != null) {
-      throw new RuntimeIOException(message, cause);
+    if (cause == null) {
+      throw new RuntimeException(message);
+    }
+    if (cause instanceof IOException) {
+      throw new UncheckedIOException(message, (IOException) cause);
     }
-    throw new RuntimeIOException(message);
+    throw new RuntimeException(message, cause);
   }
 
   /**
    * Returns the current directory.
    * 
    * @return the current directory.
-   * @throws RuntimeIOException if the current directory cannot be obtained.
+   * @throws UncheckedIOException if the current directory cannot be obtained.
    */
   public static File currentFolder() {
     try {
       return new File(".").getCanonicalFile();
     } catch (IOException e) {
-      throw new RuntimeIOException("Unable to get current directory", e);
+      throw new UncheckedIOException("Unable to get current directory", e);
     }
   }
 
@@ -240,7 +242,7 @@ public static void delete(File 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 RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file, String charsetName) {
     checkArgumentCharsetIsSupported(charsetName);
@@ -254,14 +256,14 @@ public static String contentOf(File file, String charsetName) {
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(File file, Charset charset) {
     checkNotNull(charset, "The charset should not be null");
     try {
       return loadContents(file, charset);
     } catch (IOException e) {
-      throw new RuntimeIOException("Unable to read " + file.getAbsolutePath(), e);
+      throw new UncheckedIOException("Unable to read " + file.getAbsolutePath(), e);
     }
   }
 
@@ -284,14 +286,14 @@ private static String loadContents(File file, Charset charset) throws IOExceptio
    * @param charset the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file, Charset charset) {
     checkNotNull(charset, "The charset should not be null");
     try {
       return loadLines(file, charset);
     } catch (IOException e) {
-      throw new RuntimeIOException("Unable to read " + file.getAbsolutePath(), e);
+      throw new UncheckedIOException("Unable to read " + file.getAbsolutePath(), e);
     }
   }
 
@@ -303,7 +305,7 @@ public static List<String> linesOf(File file, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the file.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(File file, String charsetName) {
     checkArgumentCharsetIsSupported(charsetName);
diff --git a/src/main/java/org/assertj/core/util/URLs.java b/src/main/java/org/assertj/core/util/URLs.java
--- a/src/main/java/org/assertj/core/util/URLs.java
+++ b/src/main/java/org/assertj/core/util/URLs.java
@@ -20,8 +20,6 @@
 import java.nio.charset.Charset;
 import java.util.List;
 
-import org.assertj.core.api.exception.RuntimeIOException;
-
 /**
  * Utility methods related to URLs.
  *
@@ -40,7 +38,7 @@ private URLs() {
    * @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 RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url, String charsetName) {
     checkArgumentCharsetIsSupported(charsetName);
@@ -54,14 +52,14 @@ public static String contentOf(URL url, String charsetName) {
    * @param charset the character set to use.
    * @return the content of the URL.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static String contentOf(URL url, Charset charset) {
     checkNotNull(charset, "The charset should not be null");
     try {
       return loadContents(url.openStream(), charset);
     } catch (IOException e) {
-      throw new RuntimeIOException("Unable to read " + url, e);
+      throw new UncheckedIOException("Unable to read " + url, e);
     }
   }
 
@@ -73,14 +71,14 @@ public static String contentOf(URL url, Charset charset) {
    * @param charset the character set to use.
    * @return the content of the URL.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url, Charset charset) {
     checkNotNull(charset, "The charset should not be null");
     try {
       return loadLines(url.openStream(), charset);
     } catch (IOException e) {
-      throw new RuntimeIOException("Unable to read " + url, e);
+      throw new UncheckedIOException("Unable to read " + url, e);
     }
   }
 
@@ -92,7 +90,7 @@ public static List<String> linesOf(URL url, Charset charset) {
    * @param charsetName the name of the character set to use.
    * @return the content of the URL.
    * @throws NullPointerException if the given charset is {@code null}.
-   * @throws RuntimeIOException if an I/O exception occurs.
+   * @throws UncheckedIOException if an I/O exception occurs.
    */
   public static List<String> linesOf(URL url, String charsetName) {
     checkArgumentCharsetIsSupported(charsetName);


Test patch:
diff --git a/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java b/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java
--- a/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java
+++ b/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java
@@ -17,6 +17,7 @@
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.math.BigDecimal;
 import java.net.MalformedURLException;
 import java.net.URI;
@@ -43,7 +44,6 @@
 import java.util.function.Predicate;
 import java.util.stream.Stream;
 
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.condition.AnyOf;
 import org.assertj.core.data.MapEntry;
 import org.junit.Test;
@@ -589,7 +589,7 @@ public void withAssertions_doesNotHave_condition_Test() {
   /**
    * Test that the delegate method is called.
    */
-  @Test(expected = RuntimeIOException.class)
+  @Test(expected = UncheckedIOException.class)
   public void withAssertions_contentOf_Test() {
     contentOf(new File("/non-existent file")).contains("a");
   }
@@ -597,7 +597,7 @@ public void withAssertions_contentOf_Test() {
   /**
    * Test that the delegate method is called.
    */
-  @Test(expected = RuntimeIOException.class)
+  @Test(expected = UncheckedIOException.class)
   public void withAssertions_contentOf_with_charset_Test() {
     contentOf(new File("/non-existent file", "UTF-8")).contains("a");
   }
@@ -605,7 +605,7 @@ public void withAssertions_contentOf_with_charset_Test() {
   /**
    * Test that the delegate method is called.
    */
-  @Test(expected = RuntimeIOException.class)
+  @Test(expected = UncheckedIOException.class)
   public void withAssertions_linesOf_Test() {
     linesOf(new File("/non-existent file")).contains("a");
   }
@@ -613,7 +613,7 @@ public void withAssertions_linesOf_Test() {
   /**
    * Test that the delegate method is called.
    */
-  @Test(expected = RuntimeIOException.class)
+  @Test(expected = UncheckedIOException.class)
   public void withAssertions_linesOf_with_charsetTest() {
     linesOf(new File("/non-existent file", "UTF-8")).contains("a");
   }
diff --git a/src/test/java/org/assertj/core/internal/files/Files_assertHasBinaryContent_Test.java b/src/test/java/org/assertj/core/internal/files/Files_assertHasBinaryContent_Test.java
--- a/src/test/java/org/assertj/core/internal/files/Files_assertHasBinaryContent_Test.java
+++ b/src/test/java/org/assertj/core/internal/files/Files_assertHasBinaryContent_Test.java
@@ -22,9 +22,9 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 
 import org.assertj.core.api.AssertionInfo;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.BinaryDiffResult;
 import org.assertj.core.internal.Files;
 import org.assertj.core.internal.FilesBaseTest;
@@ -86,7 +86,7 @@ public void should_throw_error_wrapping_catched_IOException() throws IOException
     IOException cause = new IOException();
     when(binaryDiff.diff(actual, expected)).thenThrow(cause);
 
-    thrown.expectWithCause(RuntimeIOException.class, cause);
+    thrown.expectWithCause(UncheckedIOException.class, cause);
 
     files.assertHasBinaryContent(someInfo(), actual, expected);
   }
diff --git a/src/test/java/org/assertj/core/internal/files/Files_assertHasContent_Test.java b/src/test/java/org/assertj/core/internal/files/Files_assertHasContent_Test.java
--- a/src/test/java/org/assertj/core/internal/files/Files_assertHasContent_Test.java
+++ b/src/test/java/org/assertj/core/internal/files/Files_assertHasContent_Test.java
@@ -22,12 +22,12 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.assertj.core.api.AssertionInfo;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.Files;
 import org.assertj.core.internal.FilesBaseTest;
 import org.assertj.core.util.Lists;
@@ -92,7 +92,7 @@ public void should_throw_error_wrapping_catched_IOException() throws IOException
     IOException cause = new IOException();
     when(diff.diff(actual, expected, charset)).thenThrow(cause);
 
-    thrown.expectWithCause(RuntimeIOException.class, cause);
+    thrown.expectWithCause(UncheckedIOException.class, cause);
 
     files.assertHasContent(someInfo(), actual, expected, charset);
   }
diff --git a/src/test/java/org/assertj/core/internal/files/Files_assertHasParent_Test.java b/src/test/java/org/assertj/core/internal/files/Files_assertHasParent_Test.java
--- a/src/test/java/org/assertj/core/internal/files/Files_assertHasParent_Test.java
+++ b/src/test/java/org/assertj/core/internal/files/Files_assertHasParent_Test.java
@@ -13,12 +13,12 @@
 package org.assertj.core.internal.files;
 
 import org.assertj.core.api.AssertionInfo;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.FilesBaseTest;
 import org.junit.Test;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 
 import static org.assertj.core.error.ShouldHaveParent.shouldHaveParent;
 import static org.assertj.core.test.TestData.someInfo;
@@ -95,7 +95,7 @@ public void should_pass_if_actual_has_expected_parent_when_actual_form_is_canoni
 
   @Test
   public void should_throw_exception_when_canonical_form_representation_fail() throws Exception {
-    thrown.expect(RuntimeIOException.class);
+    thrown.expect(UncheckedIOException.class);
 
     File actual = mock(File.class);
     File expectedParent = mock(File.class);
@@ -108,7 +108,7 @@ public void should_throw_exception_when_canonical_form_representation_fail() thr
 
   @Test
   public void should_throw_exception_when_canonical_form_representation_fail_for_expected_parent() throws Exception {
-    thrown.expect(RuntimeIOException.class);
+    thrown.expect(UncheckedIOException.class);
 
     File expectedParent = mock(File.class);
     when(expectedParent.getCanonicalFile()).thenThrow(new IOException());
diff --git a/src/test/java/org/assertj/core/internal/files/Files_assertSameContentAs_Test.java b/src/test/java/org/assertj/core/internal/files/Files_assertSameContentAs_Test.java
--- a/src/test/java/org/assertj/core/internal/files/Files_assertSameContentAs_Test.java
+++ b/src/test/java/org/assertj/core/internal/files/Files_assertSameContentAs_Test.java
@@ -25,12 +25,12 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.math.BigInteger;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.assertj.core.api.AssertionInfo;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.BinaryDiffResult;
 import org.assertj.core.internal.FilesBaseTest;
 import org.assertj.core.util.Lists;
@@ -41,7 +41,7 @@
 import org.junit.rules.TemporaryFolder;
 
 /**
- * Tests for <code>{@link org.assertj.core.internal.Files#assertSameContentAs(org.assertj.core.api.AssertionInfo, java.io.File, java.io.File)}</code>.
+ * Tests for <code>{@link org.assertj.core.internal.Files#assertSameContentAs(org.assertj.core.api.AssertionInfo, java.io.File, java.nio.charset.Charset, java.io.File,  java.nio.charset.Charset)}</code>.
  *
  * @author Yvonne Wang
  * @author Joel Costigliola
@@ -103,7 +103,7 @@ public void should_throw_error_wrapping_catched_IOException() throws IOException
     IOException cause = new IOException();
     when(diff.diff(actual, defaultCharset(), expected, defaultCharset())).thenThrow(cause);
 
-    thrown.expectWithCause(RuntimeIOException.class, cause);
+    thrown.expectWithCause(UncheckedIOException.class, cause);
 
     files.assertSameContentAs(someInfo(), actual, defaultCharset(), expected, defaultCharset());
   }
@@ -125,7 +125,7 @@ public void should_fail_if_files_do_not_have_equal_content() throws IOException
 
   @Test
   public void should_throw_an_error_if_files_cant_be_compared_with_the_given_charsets_even_if_binary_identical() throws IOException {
-    thrown.expectWithMessageStartingWith(RuntimeIOException.class, "Unable to compare contents of files");
+    thrown.expectWithMessageStartingWith(UncheckedIOException.class, "Unable to compare contents of files");
     unMockedFiles.assertSameContentAs(someInfo(),
                                       createFileWithNonUTF8Character(), StandardCharsets.UTF_8,
                                       createFileWithNonUTF8Character(), StandardCharsets.UTF_8);
diff --git a/src/test/java/org/assertj/core/internal/paths/Paths_assertHasBinaryContent_Test.java b/src/test/java/org/assertj/core/internal/paths/Paths_assertHasBinaryContent_Test.java
--- a/src/test/java/org/assertj/core/internal/paths/Paths_assertHasBinaryContent_Test.java
+++ b/src/test/java/org/assertj/core/internal/paths/Paths_assertHasBinaryContent_Test.java
@@ -25,10 +25,10 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.file.Path;
 
 import org.assertj.core.api.AssertionInfo;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.BinaryDiffResult;
 import org.assertj.core.internal.Paths;
 import org.assertj.core.internal.PathsBaseTest;
@@ -111,7 +111,7 @@ public void should_throw_error_wrapping_catched_IOException() throws IOException
 	when(nioFilesWrapper.exists(path)).thenReturn(true);
 	when(nioFilesWrapper.isReadable(path)).thenReturn(true);
 
-    thrown.expectWithCause(RuntimeIOException.class, cause);
+    thrown.expectWithCause(UncheckedIOException.class, cause);
 
     paths.assertHasBinaryContent(someInfo(), path, expected);
   }
diff --git a/src/test/java/org/assertj/core/internal/paths/Paths_assertHasContent_Test.java b/src/test/java/org/assertj/core/internal/paths/Paths_assertHasContent_Test.java
--- a/src/test/java/org/assertj/core/internal/paths/Paths_assertHasContent_Test.java
+++ b/src/test/java/org/assertj/core/internal/paths/Paths_assertHasContent_Test.java
@@ -25,13 +25,13 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.assertj.core.api.AssertionInfo;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.Paths;
 import org.assertj.core.internal.PathsBaseTest;
 import org.assertj.core.util.diff.Delta;
@@ -119,7 +119,7 @@ public void should_throw_error_wrapping_catched_IOException() throws IOException
 	when(nioFilesWrapper.exists(path)).thenReturn(true);
 	when(nioFilesWrapper.isReadable(path)).thenReturn(true);
 
-    thrown.expectWithCause(RuntimeIOException.class, cause);
+    thrown.expectWithCause(UncheckedIOException.class, cause);
 
     paths.assertHasContent(someInfo(), path, expected, charset);
   }
diff --git a/src/test/java/org/assertj/core/internal/paths/Paths_assertHasSameContentAs_Test.java b/src/test/java/org/assertj/core/internal/paths/Paths_assertHasSameContentAs_Test.java
--- a/src/test/java/org/assertj/core/internal/paths/Paths_assertHasSameContentAs_Test.java
+++ b/src/test/java/org/assertj/core/internal/paths/Paths_assertHasSameContentAs_Test.java
@@ -26,18 +26,19 @@
 import static org.mockito.Mockito.when;
 
 import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.charset.Charset;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.assertj.core.api.AssertionInfo;
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.internal.Paths;
 import org.assertj.core.util.diff.Delta;
 import org.junit.Test;
 
 /**
- * Tests for <code>{@link Paths#assertHasSameContentAs(AssertionInfo, Path, Path)}</code>.
+ * Tests for <code>{@link Paths#assertHasSameContentAs(AssertionInfo, Path, Charset, Path, Charset)}</code>.
  */
 public class Paths_assertHasSameContentAs_Test extends MockPathsBaseTest {
 
@@ -109,7 +110,7 @@ public void should_throw_error_wrapping_catched_IOException() throws IOException
 	when(nioFilesWrapper.isReadable(actual)).thenReturn(true);
 	when(nioFilesWrapper.isReadable(other)).thenReturn(true);
 
-    thrown.expectWithCause(RuntimeIOException.class, cause);
+    thrown.expectWithCause(UncheckedIOException.class, cause);
 
     paths.assertHasSameContentAs(someInfo(), actual, defaultCharset(), other, defaultCharset());
   }
diff --git a/src/test/java/org/assertj/core/util/Files_contentOf_Test.java b/src/test/java/org/assertj/core/util/Files_contentOf_Test.java
--- a/src/test/java/org/assertj/core/util/Files_contentOf_Test.java
+++ b/src/test/java/org/assertj/core/util/Files_contentOf_Test.java
@@ -16,10 +16,10 @@
 import static org.assertj.core.test.ExpectedException.none;
 
 import java.io.File;
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.junit.Rule;
 import org.junit.Test;
 import org.assertj.core.test.ExpectedException;
@@ -54,7 +54,7 @@ public void should_throw_exception_if_file_not_found() {
     File missingFile = new File("missing.txt");
     assertThat(missingFile.exists()).isFalse();
 
-    thrown.expect(RuntimeIOException.class);
+    thrown.expect(UncheckedIOException.class);
     Files.contentOf(missingFile, Charset.defaultCharset());
   }
 
diff --git a/src/test/java/org/assertj/core/util/Files_linesOf_Test.java b/src/test/java/org/assertj/core/util/Files_linesOf_Test.java
--- a/src/test/java/org/assertj/core/util/Files_linesOf_Test.java
+++ b/src/test/java/org/assertj/core/util/Files_linesOf_Test.java
@@ -12,12 +12,12 @@
  */
 package org.assertj.core.util;
 
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.assertj.core.test.ExpectedException;
 import org.junit.Rule;
 import org.junit.Test;
 
 import java.io.File;
+import java.io.UncheckedIOException;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
@@ -62,7 +62,7 @@ public void should_throw_exception_if_file_not_found() {
     File missingFile = new File("missing.txt");
     assertThat(missingFile).doesNotExist();
 
-    thrown.expect(RuntimeIOException.class);
+    thrown.expect(UncheckedIOException.class);
     linesOf(missingFile, Charset.defaultCharset());
   }
 
diff --git a/src/test/java/org/assertj/core/util/Files_newFile_Test.java b/src/test/java/org/assertj/core/util/Files_newFile_Test.java
--- a/src/test/java/org/assertj/core/util/Files_newFile_Test.java
+++ b/src/test/java/org/assertj/core/util/Files_newFile_Test.java
@@ -19,7 +19,6 @@
 
 import java.io.File;
 
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
@@ -37,14 +36,14 @@ public class Files_newFile_Test extends Files_TestCase {
 
   @Test
   public void should_throw_error_if_file_path_belongs_to_directory_that_is_not_empty() {
-    thrown.expect(RuntimeIOException.class);
+    thrown.expect(RuntimeException.class);
     Files.newFile("root");
   }
 
   @Test
   public void should_throw_error_if_file_path_belongs_to_an_existing_file() {
     String path = join("root", "dir_1", "file_1_1").with(separator);
-    thrown.expect(RuntimeIOException.class);
+    thrown.expect(RuntimeException.class);
     Files.newFile(path);
   }
 
diff --git a/src/test/java/org/assertj/core/util/URLs_contentOf_Test.java b/src/test/java/org/assertj/core/util/URLs_contentOf_Test.java
--- a/src/test/java/org/assertj/core/util/URLs_contentOf_Test.java
+++ b/src/test/java/org/assertj/core/util/URLs_contentOf_Test.java
@@ -13,12 +13,12 @@
 package org.assertj.core.util;
 
 
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
 import java.io.File;
+import java.io.UncheckedIOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.charset.Charset;
@@ -46,7 +46,7 @@ public void should_throw_exception_if_url_not_found() throws MalformedURLExcepti
     File missingFile = new File("missing.txt");
     assertThat(missingFile.exists()).isFalse();
 
-    thrown.expect(RuntimeIOException.class);
+    thrown.expect(UncheckedIOException.class);
     URLs.contentOf(missingFile.toURI().toURL(), Charset.defaultCharset());
   }
 
diff --git a/src/test/java/org/assertj/core/util/URLs_linesOf_Test.java b/src/test/java/org/assertj/core/util/URLs_linesOf_Test.java
--- a/src/test/java/org/assertj/core/util/URLs_linesOf_Test.java
+++ b/src/test/java/org/assertj/core/util/URLs_linesOf_Test.java
@@ -12,12 +12,12 @@
  */
 package org.assertj.core.util;
 
-import org.assertj.core.api.exception.RuntimeIOException;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
 import java.io.File;
+import java.io.UncheckedIOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.charset.Charset;
@@ -48,7 +48,7 @@ public void should_throw_exception_if_url_not_found() throws MalformedURLExcepti
     File missingFile = new File("missing.txt");
     assertThat(missingFile).doesNotExist();
 
-    thrown.expect(RuntimeIOException.class);
+    thrown.expect(UncheckedIOException.class);
     URLs.linesOf(missingFile.toURI().toURL(), Charset.defaultCharset());
   }