code: public synchronized static boolean safeRenameIfNotExists(FileSystem fs, Path from, Path to) throws IOException {
      return unsafeRenameIfNotExists(fs, from, to);
    }
docs: Renames from to to if to doesn't exist in a thread-safe way. This method is necessary because
  {@link FileSystem#rename} is inconsistent across file system implementations, e.g. in some of them rename(foo, bar)
  will create bar/foo if bar already existed, but it will only create bar if it didn't.
  
  <p>
  The thread-safety is only guaranteed among calls to this method. An external modification to the relevant
  target directory could still cause unexpected results in the renaming.
  </p>
  
  @param fs filesystem where rename will be executed.
  @param from origin {@link Path}.
  @param to target {@link Path}.
  @return true if rename succeeded, false if the target already exists.
  @throws IOException if rename failed for reasons other than target exists.