|
@@ 594-606 (lines=13) @@
|
| 591 |
|
* @link https://www.dropbox.com/developers/documentation/http/documentation#files-move |
| 592 |
|
* |
| 593 |
|
*/ |
| 594 |
|
public function move($fromPath, $toPath) |
| 595 |
|
{ |
| 596 |
|
//From and To paths cannot be null |
| 597 |
|
if (is_null($fromPath) || is_null($toPath)) { |
| 598 |
|
throw new DropboxClientException("From and To paths cannot be null."); |
| 599 |
|
} |
| 600 |
|
|
| 601 |
|
//Response |
| 602 |
|
$response = $this->postToAPI('/files/move', ['from_path' => $fromPath, 'to_path' => $toPath]); |
| 603 |
|
|
| 604 |
|
//Make and Return the Model |
| 605 |
|
return $this->makeModelFromResponse($response); |
| 606 |
|
} |
| 607 |
|
|
| 608 |
|
/** |
| 609 |
|
* Copy a file or folder to a different location |
|
@@ 621-633 (lines=13) @@
|
| 618 |
|
* @link https://www.dropbox.com/developers/documentation/http/documentation#files-copy |
| 619 |
|
* |
| 620 |
|
*/ |
| 621 |
|
public function copy($fromPath, $toPath) |
| 622 |
|
{ |
| 623 |
|
//From and To paths cannot be null |
| 624 |
|
if (is_null($fromPath) || is_null($toPath)) { |
| 625 |
|
throw new DropboxClientException("From and To paths cannot be null."); |
| 626 |
|
} |
| 627 |
|
|
| 628 |
|
//Response |
| 629 |
|
$response = $this->postToAPI('/files/copy', ['from_path' => $fromPath, 'to_path' => $toPath]); |
| 630 |
|
|
| 631 |
|
//Make and Return the Model |
| 632 |
|
return $this->makeModelFromResponse($response); |
| 633 |
|
} |
| 634 |
|
|
| 635 |
|
/** |
| 636 |
|
* Restore a file to the specific version |
|
@@ 737-749 (lines=13) @@
|
| 734 |
|
* |
| 735 |
|
* @throws \Kunnu\Dropbox\Exceptions\DropboxClientException |
| 736 |
|
*/ |
| 737 |
|
public function getTemporaryLink($path) |
| 738 |
|
{ |
| 739 |
|
//Path cannot be null |
| 740 |
|
if (is_null($path)) { |
| 741 |
|
throw new DropboxClientException("Path cannot be null."); |
| 742 |
|
} |
| 743 |
|
|
| 744 |
|
//Get Temporary Link |
| 745 |
|
$response = $this->postToAPI('/files/get_temporary_link', ['path' => $path]); |
| 746 |
|
|
| 747 |
|
//Make and Return the Model |
| 748 |
|
return $this->makeModelFromResponse($response); |
| 749 |
|
} |
| 750 |
|
|
| 751 |
|
/** |
| 752 |
|
* Save a specified URL into a file in user's Dropbox |