public function moveToDirectory(string $newDirectoryPath, bool $overwrite = true): self
    {
        $newDirectoryPath = normalize_path($newDirectoryPath);

        if (is_dir($newDirectoryPath)) {
            if (is_writable($newDirectoryPath)) {
                $newFilePath = $newDirectoryPath.DIRECTORY_SEPARATOR.$this->getName();
                if ($overwrite || !is_file($newFilePath)) {
                    if ((is_file($newFilePath) && is_writeable($newFilePath)) || !is_file($newFilePath)) {
                        return $this->move($newFilePath, $overwrite);
                    }
                    throw new FileException('Cannot move the file, because the existing file ('.$newFilePath.') is not writable and cannot be overwritten',
                        FileException::NOT_WRITEABLE);
                }
                throw new FileException('Cannot move the file, because a file with the same name ('.$newFilePath.') already exists',
                    FileException::ALREADY_EXIST);
            }
            throw new FolderException('Cannot move the file, because the new directory path ('.$newDirectoryPath.') is not writable',
                FolderException::NOT_WRITEABLE);
        }
        throw new FolderException('Cannot move the file, because the new directory path ('.$newDirectoryPath.') does not exist',
            FolderException::DONT_EXIST);
    }