Moves file from one place to another, can across storage devices (e.g., from memory to SSD)
when {@link File#renameTo} may not work.

@param srcPath pathname string of source file
@param dstPath pathname string of destination file
172084
public static void move(String srcPath, String dstPath) throws IOException {
    Files.move(Paths.get(srcPath), Paths.get(dstPath), StandardCopyOption.REPLACE_EXISTING);
  }
387569
public static File copy(String srcPath, String destPath, boolean isOverride) throws IORuntimeException {
		return copy(file(srcPath), file(destPath), isOverride);
	}
406676
@Override
  protected void movePath(ParallelRunner parallelRunner, State state, Path src, Path dst, int branchId)
      throws IOException {

    String outputDir = dst.getParent().toString();
    String schemaName = dst.getName();
    Path newDst = new Path(new Path(outputDir, getDbTableName(schemaName)), timestamp);

    if (!this.publisherFileSystemByBranches.get(branchId).exists(newDst)) {
      WriterUtils.mkdirsWithRecursivePermissionWithRetry(this.publisherFileSystemByBranches.get(branchId),
          newDst.getParent(), this.permissions.get(branchId), this.retrierConfig);
    }

    super.movePath(parallelRunner, state, src, newDst, branchId);
  }
166851
@Override
  public boolean rename(final Path src, final Path dst) throws IOException {
    LOG.debug("rename from {} to {}", src, dst);
    if (src == null || dst == null) {
      LOG.debug("Source path and dest path can not be null");
      return false;
    }
    if (stocatorPath.isTemporaryPath(src)) {
      return true;
    }
    LOG.debug("Checking if source exists {}", src);
    if (!exists(src)) {
      LOG.debug("Source {} does not exists. Exit", src);
      return false;
    }
    final Path srcPath = storageClient.qualify(src);
    final Path dstPath = storageClient.qualify(dst);
    return storageClient.rename(hostNameScheme, srcPath.toString(), dstPath.toString());
  }
696790
public void moveThisFile(File fileSource, File fileDestDir, String strDestName)
    {
        fileDestDir.mkdirs();
        String strNewDir = this.getNewCalendarPath(fileSource);
        if (strNewDir != null)
        {
            fileDestDir = new File(fileDestDir, strNewDir);
            fileDestDir.mkdirs();
        }
        File fileDest = new File(fileDestDir, strDestName);
        if (fileSource.renameTo(fileDest))
            return;
        if (true)
        {
            System.out.println("Warning, system does not support move file");
            return;
        }
        super.moveThisFile(fileSource, fileDestDir, strDestName);
        if (strNewDir == null)
            return;   // Moving to a different dir = move all.
        fileSource.delete();    // Moving to the same dir (into the new directory) means delete to old file at the root
    }
1122627
public void copyToLocalFile(boolean delSrc, boolean validate,
      Path src, Path dst)
  throws IOException {
    FileUtil.copy(this, src, getLocal(getConf()), dst, delSrc,
        validate, getConf());
  }
667920
public function rename(string $srcPath, string $dstPath): bool
    {
        $partition = self::getPartition($srcPath);

        $srcRelativePath = self::getRelativePath($srcPath);
        $dstRelativePath = self::getRelativePath($dstPath);

        return (bool) $partition->rename($srcRelativePath, $dstRelativePath);
    }
1364956
@Override
  @Direct
  public void renameTo(String relPath,
                     Result<Boolean> result,
                     WriteOption ...options)
  {
    _root.renameTo(_path, toAbsolute(relPath), result, options);
  }
895966
@Override
    public T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException {
        Validate.notNull(source, "The source path was not specified");
        Validate.notNull(target, "The target path was not specified");

        final Node nodeToMove = get(source);
        if (null == nodeToMove) {
           throw new IllegalArchivePathException(source.get() + " doesn't specify any node in the archive to move");
        }
        final Asset asset = nodeToMove.getAsset();
        // Directory?
        if (asset == null) {
            this.addAsDirectory(target);
        } else {
            add(asset, target);
        }

        // move children
        final Set<Node> nodeToMoveChildren = nodeToMove.getChildren();
        for (final Node child : nodeToMoveChildren) {
            final String childName = child.getPath().get().replaceFirst(child.getPath().getParent().get(), "");
            final ArchivePath childTargetPath = ArchivePaths.create(target, childName);
            move(child.getPath(), childTargetPath);
        }

        delete(source);

        return covariantReturn();
    }
1281244
def move(self, old_path, new_path, raise_if_exists=False):
        
        if raise_if_exists and os.path.exists(new_path):
            raise FileAlreadyExists('Destination exists: %s' % new_path)
        d = os.path.dirname(new_path)
        if d and not os.path.exists(d):
            self.mkdir(d)
        try:
            os.rename(old_path, new_path)
        except OSError as err:
            if err.errno == errno.EXDEV:
                new_path_tmp = '%s-%09d' % (new_path, random.randint(0, 999999999))
                shutil.copy(old_path, new_path_tmp)
                os.rename(new_path_tmp, new_path)
                os.remove(old_path)
            else:
                raise err
770647
@SuppressWarnings("ResultOfMethodCallIgnored") void updateDestinationFilePath(String filename) {
    String separator = destinationDirectory.endsWith("/") ? "" : File.separator;
    destinationFilePath = destinationDirectory + separator + filename;
    Log.d("TAG", "destinationFilePath: " + destinationFilePath);
    /* if the destination path is directory */
    File file = new File(destinationFilePath);
    if (!file.getParentFile().exists()) {
      /* make dirs in case */
      file.getParentFile().mkdirs();
    }
  }
892
public static void renamePath(FileSystem fs, Path oldName, Path newName, boolean overwrite) throws IOException {
    if (!fs.exists(oldName)) {
      throw new FileNotFoundException(String.format("Failed to rename %s to %s: src not found", oldName, newName));
    }
    if (fs.exists(newName)) {
      if (overwrite) {
        HadoopUtils.moveToTrash(fs, newName);
      } else {
        throw new FileAlreadyExistsException(
            String.format("Failed to rename %s to %s: dst already exists", oldName, newName));
      }
    }
    if (!fs.rename(oldName, newName)) {
      throw new IOException(String.format("Failed to rename %s to %s", oldName, newName));
    }
  }
1117810
def move(self, path, destination):
        
        args = {
            'path': path,
            'destination': destination,
        }

        return self._client.json('filesystem.move', args)
1334519
public boolean rename(Path src, Path dst) throws IOException {
    if (fs.isDirectory(src)) {
      return fs.rename(src, dst);
    } else {

      boolean value = fs.rename(src, dst);
      if (!value)
        return false;

      Path checkFile = getChecksumFile(src);
      if (fs.exists(checkFile)) { //try to rename checksum
        if (fs.isDirectory(dst)) {
          value = fs.rename(checkFile, dst);
        } else {
          value = fs.rename(checkFile, getChecksumFile(dst));
        }
      }

      return value;
    }
  }
1134155
public function moveToPathWithClientsFileName(string $path)
    {
        return $this->process(FileMoverProcessor::withClientFileName($this->movedClassName(), $path));
    }
1346781
public static function move($sourcePath, $destinationPath)
    {
        if (!self::exists($sourcePath)) {
            throw new FileNotFoundException('Cannot find source file: ' . $sourcePath);
        }
        return rename($sourcePath, $destinationPath);
    }
1027978
public static void renamePath(FileSystem fs, Path oldName, Path newName) throws IOException {
    renamePath(fs, oldName, newName, false);
  }