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