public final function loadFileContentFromFuture(Future $future) { if ($this->timeout) { $future->setTimeout($this->timeout); } if ($this->getByteLimit()) { $future->setStdoutSizeLimit($this->getByteLimit()); } try { $file_content = $this->executeQueryFromFuture($future); } catch (CommandException $ex) { if (!$future->getWasKilledByTimeout()) { throw $ex; } $message = pht('<Attempt to load this file was terminated after %s second(s).>', $this->timeout); $file_content = new DiffusionFileContent(); $file_content->setCorpus($message); } $this->fileContent = $file_content; $repository = $this->getRequest()->getRepository(); $try_encoding = $repository->getDetail('encoding'); if ($try_encoding) { $this->fileContent->setCorpus(phutil_utf8_convert($this->fileContent->getCorpus(), 'UTF-8', $try_encoding)); } return $this->fileContent; }