|
@@ 547-559 (lines=13) @@
|
| 544 |
|
* @link https://www.dropbox.com/developers/documentation/http/documentation#files-move |
| 545 |
|
* |
| 546 |
|
*/ |
| 547 |
|
public function move($fromPath, $toPath) |
| 548 |
|
{ |
| 549 |
|
//From and To paths cannot be null |
| 550 |
|
if (is_null($fromPath) || is_null($toPath)) { |
| 551 |
|
throw new DropboxClientException("From and To paths cannot be null."); |
| 552 |
|
} |
| 553 |
|
|
| 554 |
|
//Response |
| 555 |
|
$response = $this->postToAPI('/files/move', ['from_path' => $fromPath, 'to_path' => $toPath]); |
| 556 |
|
|
| 557 |
|
//Make and Return the Model |
| 558 |
|
return $this->makeModelFromResponse($response); |
| 559 |
|
} |
| 560 |
|
|
| 561 |
|
/** |
| 562 |
|
* Copy a file or folder to a different location |
|
@@ 574-586 (lines=13) @@
|
| 571 |
|
* @link https://www.dropbox.com/developers/documentation/http/documentation#files-copy |
| 572 |
|
* |
| 573 |
|
*/ |
| 574 |
|
public function copy($fromPath, $toPath) |
| 575 |
|
{ |
| 576 |
|
//From and To paths cannot be null |
| 577 |
|
if (is_null($fromPath) || is_null($toPath)) { |
| 578 |
|
throw new DropboxClientException("From and To paths cannot be null."); |
| 579 |
|
} |
| 580 |
|
|
| 581 |
|
//Response |
| 582 |
|
$response = $this->postToAPI('/files/copy', ['from_path' => $fromPath, 'to_path' => $toPath]); |
| 583 |
|
|
| 584 |
|
//Make and Return the Model |
| 585 |
|
return $this->makeModelFromResponse($response); |
| 586 |
|
} |
| 587 |
|
|
| 588 |
|
/** |
| 589 |
|
* Restore a file to the specific version |
|
@@ 689-701 (lines=13) @@
|
| 686 |
|
* |
| 687 |
|
* @throws \Kunnu\Dropbox\Exceptions\DropboxClientException |
| 688 |
|
*/ |
| 689 |
|
public function getTemporaryLink($path) |
| 690 |
|
{ |
| 691 |
|
//Path cannot be null |
| 692 |
|
if (is_null($path)) { |
| 693 |
|
throw new DropboxClientException("Path cannot be null."); |
| 694 |
|
} |
| 695 |
|
|
| 696 |
|
//Get Temporary Link |
| 697 |
|
$response = $this->postToAPI('/files/get_temporary_link', ['path' => $path]); |
| 698 |
|
|
| 699 |
|
//Make and Return the Model |
| 700 |
|
return $this->makeModelFromResponse($response); |
| 701 |
|
} |
| 702 |
|
|
| 703 |
|
/** |
| 704 |
|
* Save a specified URL into a file in user's Dropbox |