@@ 533-548 (lines=16) @@ | ||
530 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-create_folder |
|
531 | * |
|
532 | */ |
|
533 | public function createFolder($path, $autorename = false) |
|
534 | { |
|
535 | //Path cannot be null |
|
536 | if (is_null($path)) { |
|
537 | throw new DropboxClientException("Path cannot be null."); |
|
538 | } |
|
539 | ||
540 | //Create Folder |
|
541 | $response = $this->postToAPI('/files/create_folder', ['path' => $path, 'autorename' => $autorename]); |
|
542 | ||
543 | //Fetch the Metadata |
|
544 | $body = $response->getDecodedBody(); |
|
545 | ||
546 | //Make and Return the Model |
|
547 | return new FolderMetadata($body); |
|
548 | } |
|
549 | ||
550 | /** |
|
551 | * Delete a file or folder at the given path |
|
@@ 648-663 (lines=16) @@ | ||
645 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-restore |
|
646 | * |
|
647 | */ |
|
648 | public function restore($path, $rev) |
|
649 | { |
|
650 | //Path and Revision cannot be null |
|
651 | if (is_null($path) || is_null($rev)) { |
|
652 | throw new DropboxClientException("Path and Revision cannot be null."); |
|
653 | } |
|
654 | ||
655 | //Response |
|
656 | $response = $this->postToAPI('/files/restore', ['path' => $path, 'rev' => $rev]); |
|
657 | ||
658 | //Fetch the Metadata |
|
659 | $body = $response->getDecodedBody(); |
|
660 | ||
661 | //Make and Return the Model |
|
662 | return new FileMetadata($body); |
|
663 | } |
|
664 | ||
665 | /** |
|
666 | * Get Copy Reference |
|
@@ 677-690 (lines=14) @@ | ||
674 | * @link https://www.dropbox.com/developers/documentation/http/documentation#files-copy_reference-get |
|
675 | * |
|
676 | */ |
|
677 | public function getCopyReference($path) |
|
678 | { |
|
679 | //Path cannot be null |
|
680 | if (is_null($path)) { |
|
681 | throw new DropboxClientException("Path cannot be null."); |
|
682 | } |
|
683 | ||
684 | //Get Copy Reference |
|
685 | $response = $this->postToAPI('/files/copy_reference/get', ['path' => $path]); |
|
686 | $body = $response->getDecodedBody(); |
|
687 | ||
688 | //Make and Return the Model |
|
689 | return new CopyReference($body); |
|
690 | } |
|
691 | ||
692 | /** |
|
693 | * Save Copy Reference |