Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/conduit/FileDownloadConduitAPIMethod.php
<?php | <?php | ||||
final class FileDownloadConduitAPIMethod extends FileConduitAPIMethod { | final class FileDownloadConduitAPIMethod extends FileConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'file.download'; | return 'file.download'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Download a file from the server.'; | return 'Download a file from the server.'; | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'phid' => 'required phid', | 'phid' => 'required phid', | ||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'nonempty base64-bytes'; | return 'nonempty base64-bytes'; | ||||
} | } | ||||
public function defineErrorTypes() { | protected function defineErrorTypes() { | ||||
return array( | return array( | ||||
'ERR-BAD-PHID' => 'No such file exists.', | 'ERR-BAD-PHID' => 'No such file exists.', | ||||
); | ); | ||||
} | } | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$phid = $request->getValue('phid'); | $phid = $request->getValue('phid'); | ||||
Show All 12 Lines |