3 final class FileQueryChunksConduitAPIMethod
4 extends FileConduitAPIMethod
{
6 public function getAPIMethodName() {
7 return 'file.querychunks';
10 public function getMethodDescription() {
11 return pht('Get information about file chunks.');
14 protected function defineParamTypes() {
20 protected function defineReturnType() {
24 protected function execute(ConduitAPIRequest
$request) {
25 $viewer = $request->getUser();
27 $file_phid = $request->getValue('filePHID');
28 $file = $this->loadFileByPHID($viewer, $file_phid);
29 $chunks = $this->loadFileChunks($viewer, $file);
32 foreach ($chunks as $chunk) {
34 'byteStart' => $chunk->getByteStart(),
35 'byteEnd' => $chunk->getByteEnd(),
36 'complete' => (bool)$chunk->getDataFilePHID(),