_defaultPath = $defaultPath; } final public function getDefaultPath(): string { return $this->_defaultPath; } final public function getPath(): string { return $this->_path; } final public function setPath(string $path): void { $this->_path = $path; } final public function getFileName(): string { return $this->_fileName; } final public function setFileName(string $fileName): void { $this->_fileName = $fileName; } final public function save($content): bool { $fullPath = $this->getDefaultPath() . DIRECTORY_SEPARATOR . $this->getPath(); if (!is_dir($fullPath)) { if (!mkdir($fullPath)) { throw new \Exception("Make Directory Error:" . $fullPath); } } $fileName = $fullPath . DIRECTORY_SEPARATOR . $this->getFileName(); log_message("debug", "download:SavePath-> " . $fileName); return file_put_contents($fileName, $content); } }