code: public boolean rename(final File from, final File to) {
      boolean renamed = false;
      if (this.isWriteable(from)) {
        renamed = from.renameTo(to);
      } else {
        LogLog.debug(from + " is not writeable for rename (retrying)");
      }
      if (!renamed) {
        from.renameTo(to);
        renamed = (!from.exists());
      }
      return renamed;
    }
docs: Rename with retry.
  
  @param from
  @param to
  @return <tt>true</tt> if the file was successfully renamed.