@@ 485-500 (lines=16) @@ | ||
482 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-create_folder |
|
483 | * |
|
484 | */ |
|
485 | public function createFolder($path, $autorename = false) |
|
486 | { |
|
487 | //Path cannot be null |
|
488 | if (is_null($path)) { |
|
489 | throw new DropboxClientException("Path cannot be null."); |
|
490 | } |
|
491 | ||
492 | //Create Folder |
|
493 | $response = $this->postToAPI('/files/create_folder', ['path' => $path, 'autorename' => $autorename]); |
|
494 | ||
495 | //Fetch the Metadata |
|
496 | $body = $response->getDecodedBody(); |
|
497 | ||
498 | //Make and Return the Model |
|
499 | return new FolderMetadata($body); |
|
500 | } |
|
501 | ||
502 | /** |
|
503 | * Delete a file or folder at the given path |
|
@@ 600-615 (lines=16) @@ | ||
597 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-restore |
|
598 | * |
|
599 | */ |
|
600 | public function restore($path, $rev) |
|
601 | { |
|
602 | //Path and Revision cannot be null |
|
603 | if (is_null($path) || is_null($rev)) { |
|
604 | throw new DropboxClientException("Path and Revision cannot be null."); |
|
605 | } |
|
606 | ||
607 | //Response |
|
608 | $response = $this->postToAPI('/files/restore', ['path' => $path, 'rev' => $rev]); |
|
609 | ||
610 | //Fetch the Metadata |
|
611 | $body = $response->getDecodedBody(); |
|
612 | ||
613 | //Make and Return the Model |
|
614 | return new FileMetadata($body); |
|
615 | } |
|
616 | ||
617 | /** |
|
618 | * Get Copy Reference |
|
@@ 629-642 (lines=14) @@ | ||
626 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-copy_reference-get |
|
627 | * |
|
628 | */ |
|
629 | public function getCopyReference($path) |
|
630 | { |
|
631 | //Path cannot be null |
|
632 | if (is_null($path)) { |
|
633 | throw new DropboxClientException("Path cannot be null."); |
|
634 | } |
|
635 | ||
636 | //Get Copy Reference |
|
637 | $response = $this->postToAPI('/files/copy_reference/get', ['path' => $path]); |
|
638 | $body = $response->getDecodedBody(); |
|
639 | ||
640 | //Make and Return the Model |
|
641 | return new CopyReference($body); |
|
642 | } |
|
643 | ||
644 | /** |
|
645 | * Save Copy Reference |