protected function renameFile(EntityInterface $entity, $target)
    {
        if ($entity->getFilename() && strpos($entity->getFilename(), 'tmp') !== false) {
            $filename = $entity->getFilename();
            $entity->setFilename($target.pathinfo($filename, PATHINFO_BASENAME));
            $root = $this->root.$entity->getDownloadPath().'/';
            $this->fs->copy($root.$filename, $root.$entity->getFilename(), true);
        }
    }
protected function renameFile(EntityInterface $entity, $target)
    {
        if ($entity->getFilename() && strpos($entity->getFilename(), 'tmp') !== false) {
            $filename = $entity->getFilename();
            $entity->setFilename($target.pathinfo($filename, PATHINFO_BASENAME));
            $root = $this->root.$entity->getDownloadPath().'/';
            $this->fs->copy($root.$filename, $root.$entity->getFilename(), true);
        }
    }
protected function renameFile ( EntityInterface $ entity , $ target ) { if ( $ entity -> getFilename ( ) && strpos ( $ entity -> getFilename ( ) , 'tmp' ) !== false ) { $ filename = $ entity -> getFilename ( ) ; $ entity -> setFilename ( $ target . pathinfo ( $ filename , PATHINFO_BASENAME ) ) ; $ root = $ this -> root . $ entity -> getDownloadPath ( ) . '/' ; $ this -> fs -> copy ( $ root . $ filename , $ root . $ entity -> getFilename ( ) , true ) ; } }
Rename file, if it in the temp folder.

@param EntityInterface $entity
@param string $target
Rename file if it in the temp folder .