public function finish() { foreach ($this->partList as $key => $partName) { $f = new File(Path::combine($this->getDirectoryName(), $partName)); $f->rename(str_replace($this->getPrefix(), '', $f->getPath())); $this->partList[$key] = $f->getName(); } if ($this->isCurrentPartNotEmpty()) { $this->addFooter(); $this->rename(str_replace($this->getPrefix(), '', $this->getPath())); } }