Removes the given file or directory.
(File src, File dst)
| 101 | |
| 102 | /** Removes the given file or directory. */ |
| 103 | public void mv(File src, File dst) { |
| 104 | run(() -> { |
| 105 | if (!src.exists()) { |
| 106 | throw new IllegalArgumentException("mv failed: " + src.getAbsolutePath() + " does not exist."); |
| 107 | } |
| 108 | |
| 109 | if (src.isDirectory()) { |
| 110 | FileUtils.moveDirectory(src, dst); |
| 111 | } else { |
| 112 | FileUtils.moveFile(src, dst); |
| 113 | } |
| 114 | }); |
| 115 | } |
| 116 | |
| 117 | /** Removes the given file or directory. */ |
| 118 | public void run(Throwing.Runnable action) { |