diff options
author | Andy Clement <aclement@pivotal.io> | 2021-05-14 08:16:29 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2021-05-14 08:16:29 -0700 |
commit | ab208cde4276e58334f92f7607b31e77dde8a52d (patch) | |
tree | 2db1af39c3339ada13c058c9b85be061686f21ac /util | |
parent | 1fc5195245883d306e2da3877b4fe4362ff0def9 (diff) | |
download | aspectj-ab208cde4276e58334f92f7607b31e77dde8a52d.tar.gz aspectj-ab208cde4276e58334f92f7607b31e77dde8a52d.zip |
Remove jdiff
Diffstat (limited to 'util')
-rw-r--r-- | util/src/main/java/org/aspectj/util/FileUtil.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/util/src/main/java/org/aspectj/util/FileUtil.java b/util/src/main/java/org/aspectj/util/FileUtil.java index 91686dd13..d6bf5b0a6 100644 --- a/util/src/main/java/org/aspectj/util/FileUtil.java +++ b/util/src/main/java/org/aspectj/util/FileUtil.java @@ -36,6 +36,9 @@ import java.io.Writer; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -1139,6 +1142,16 @@ public class FileUtil { r.close(); return b.toString(); } + + public static List<String> readAsLines(File file) { + try { + return Files.readAllLines(Paths.get(file.toURI())); + } catch (NoSuchFileException nsfe) { + return Collections.emptyList(); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } // /** // * Returns the contents of this stream as a String |