|
@@ 500-515 (lines=16) @@
|
| 497 |
|
* @link https://www.dropbox.com/developers/documentation/http/documentation#files-create_folder |
| 498 |
|
* |
| 499 |
|
*/ |
| 500 |
|
public function createFolder($path, $autorename = false) |
| 501 |
|
{ |
| 502 |
|
//Path cannot be null |
| 503 |
|
if (is_null($path)) { |
| 504 |
|
throw new DropboxClientException("Path cannot be null."); |
| 505 |
|
} |
| 506 |
|
|
| 507 |
|
//Create Folder |
| 508 |
|
$response = $this->postToAPI('/files/create_folder', ['path' => $path, 'autorename' => $autorename]); |
| 509 |
|
|
| 510 |
|
//Fetch the Metadata |
| 511 |
|
$body = $response->getDecodedBody(); |
| 512 |
|
|
| 513 |
|
//Make and Return the Model |
| 514 |
|
return new FolderMetadata($body); |
| 515 |
|
} |
| 516 |
|
|
| 517 |
|
/** |
| 518 |
|
* Delete a file or folder at the given path |
|
@@ 615-630 (lines=16) @@
|
| 612 |
|
* @link https://www.dropbox.com/developers/documentation/http/documentation#files-restore |
| 613 |
|
* |
| 614 |
|
*/ |
| 615 |
|
public function restore($path, $rev) |
| 616 |
|
{ |
| 617 |
|
//Path and Revision cannot be null |
| 618 |
|
if (is_null($path) || is_null($rev)) { |
| 619 |
|
throw new DropboxClientException("Path and Revision cannot be null."); |
| 620 |
|
} |
| 621 |
|
|
| 622 |
|
//Response |
| 623 |
|
$response = $this->postToAPI('/files/restore', ['path' => $path, 'rev' => $rev]); |
| 624 |
|
|
| 625 |
|
//Fetch the Metadata |
| 626 |
|
$body = $response->getDecodedBody(); |
| 627 |
|
|
| 628 |
|
//Make and Return the Model |
| 629 |
|
return new FileMetadata($body); |
| 630 |
|
} |
| 631 |
|
|
| 632 |
|
/** |
| 633 |
|
* Get Copy Reference |
|
@@ 644-657 (lines=14) @@
|
| 641 |
|
* @link https://www.dropbox.com/developers/documentation/http/documentation#files-copy_reference-get |
| 642 |
|
* |
| 643 |
|
*/ |
| 644 |
|
public function getCopyReference($path) |
| 645 |
|
{ |
| 646 |
|
//Path cannot be null |
| 647 |
|
if (is_null($path)) { |
| 648 |
|
throw new DropboxClientException("Path cannot be null."); |
| 649 |
|
} |
| 650 |
|
|
| 651 |
|
//Get Copy Reference |
| 652 |
|
$response = $this->postToAPI('/files/copy_reference/get', ['path' => $path]); |
| 653 |
|
$body = $response->getDecodedBody(); |
| 654 |
|
|
| 655 |
|
//Make and Return the Model |
| 656 |
|
return new CopyReference($body); |
| 657 |
|
} |
| 658 |
|
|
| 659 |
|
/** |
| 660 |
|
* Save Copy Reference |