guava/src/com/google/common/io/Files.java
@Beta
  public static void move(File from, File to) throws IOException {
    checkNotNull(from);
    checkNotNull(to);
    checkArgument(!from.equals(to), "Source %s and destination %s must be different", from, to);

    if (!from.renameTo(to)) {
      copy(from, to);
      if (!from.delete()) {
        if (!to.delete()) {
          throw new IOException("Unable to delete " + to);
        }
        throw new IOException("Unable to delete " + from);
      }
    }
  }
@Beta
  public static void move(File from, File to) throws IOException {
    checkNotNull(from);
    checkNotNull(to);
    checkArgument(!from.equals(to), "Source %s and destination %s must be different", from, to);

    if (!from.renameTo(to)) {
      copy(from, to);
      if (!from.delete()) {
        if (!to.delete()) {
          throw new IOException("Unable to delete " + to);
        }
        throw new IOException("Unable to delete " + from);
      }
    }
  }
Moves a file from one path to another. This method can rename a file and/or move it to a
different directory. In either case {@code to} must be the target path for the file itself; not
just the new name for the file or the path to the new parent directory.

<p><b>{@link java.nio.file.Path} equivalent:</b> {@link java.nio.file.Files#move}.

@param from the source file
@param to the destination file
@throws IOException if an I/O error occurs
@throws IllegalArgumentException if {@code from.equals(to)}