Mercurial Hosting > luan
diff src/goodjava/io/IoUtils.java @ 1497:f04bfbb08721
link_from
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 08 May 2020 16:54:30 -0600 |
parents | 91c167099462 |
children | 22e15cf73040 |
line wrap: on
line diff
--- a/src/goodjava/io/IoUtils.java Fri May 08 10:46:13 2020 -0600 +++ b/src/goodjava/io/IoUtils.java Fri May 08 16:54:30 2020 -0600 @@ -31,8 +31,12 @@ delete(file); } - public static void link(File from,File to) throws IOException { - Files.createLink( to.toPath(), from.toPath() ); + public static void link(File existing,File link) throws IOException { + Files.createLink( link.toPath(), existing.toPath() ); + } + + public static void symlink(File existing,File link) throws IOException { + Files.createSymbolicLink( link.toPath(), existing.toPath() ); } public static void copyAll(InputStream in,OutputStream out)