comparison src/goodjava/io/IoUtils.java @ 1661:08177ced7fa0

add file.copy_to
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 02 May 2022 18:56:55 -0600
parents 736ec76bbf42
children 2dbcc8360a3e
comparison
equal deleted inserted replaced
1660:2968e43cdd44 1661:08177ced7fa0
22 22
23 private IoUtils() {} // never 23 private IoUtils() {} // never
24 24
25 public static void move( File from, File to ) throws IOException { 25 public static void move( File from, File to ) throws IOException {
26 Files.move( from.toPath(), to.toPath() ); 26 Files.move( from.toPath(), to.toPath() );
27 }
28
29 public static void copy( File from, File to ) throws IOException {
30 Files.copy( from.toPath(), to.toPath() );
27 } 31 }
28 32
29 public static void delete(File file) throws IOException { 33 public static void delete(File file) throws IOException {
30 Files.deleteIfExists( file.toPath() ); 34 Files.deleteIfExists( file.toPath() );
31 } 35 }