@@ -1203,41 +1203,41 @@ |
||
1203 | 1203 | return new File($metadata, $contents); |
1204 | 1204 | } |
1205 | 1205 | |
1206 | - /** |
|
1207 | - * Download a folder as a zip file |
|
1208 | - * |
|
1209 | - * @param string $path Path to the file you want to download |
|
1210 | - * @param null|string|DropboxFile $dropboxFile DropboxFile object or Path to target file |
|
1211 | - * |
|
1212 | - * @return \Kunnu\Dropbox\Models\File |
|
1213 | - * |
|
1214 | - * @throws \Kunnu\Dropbox\Exceptions\DropboxClientException |
|
1215 | - * |
|
1216 | - * @link https://www.dropbox.com/developers/documentation/http/documentation#files-download_zip |
|
1217 | - * |
|
1218 | - */ |
|
1219 | - public function downloadZip($path, $dropboxFile = null) |
|
1220 | - { |
|
1221 | - //Path cannot be null |
|
1222 | - if (is_null($path)) { |
|
1223 | - throw new DropboxClientException("Path cannot be null."); |
|
1224 | - } |
|
1225 | - |
|
1226 | - //Make Dropbox File if target is specified |
|
1227 | - $dropboxFile = $dropboxFile ? $this->makeDropboxFile($dropboxFile, null, null, DropboxFile::MODE_WRITE) : null; |
|
1228 | - |
|
1229 | - //Download File |
|
1230 | - $response = $this->postToContent('/files/download_zip', ['path' => $path], null, $dropboxFile); |
|
1231 | - |
|
1232 | - //Get file metadata from response headers |
|
1233 | - $metadata = $this->getMetadataFromResponseHeaders($response); |
|
1234 | - |
|
1235 | - //File Contents |
|
1236 | - $contents = $dropboxFile ? $this->makeDropboxFile($dropboxFile) : $response->getBody(); |
|
1237 | - |
|
1238 | - //Make and return a File model |
|
1239 | - return new File($metadata, $contents); |
|
1240 | - } |
|
1206 | + /** |
|
1207 | + * Download a folder as a zip file |
|
1208 | + * |
|
1209 | + * @param string $path Path to the file you want to download |
|
1210 | + * @param null|string|DropboxFile $dropboxFile DropboxFile object or Path to target file |
|
1211 | + * |
|
1212 | + * @return \Kunnu\Dropbox\Models\File |
|
1213 | + * |
|
1214 | + * @throws \Kunnu\Dropbox\Exceptions\DropboxClientException |
|
1215 | + * |
|
1216 | + * @link https://www.dropbox.com/developers/documentation/http/documentation#files-download_zip |
|
1217 | + * |
|
1218 | + */ |
|
1219 | + public function downloadZip($path, $dropboxFile = null) |
|
1220 | + { |
|
1221 | + //Path cannot be null |
|
1222 | + if (is_null($path)) { |
|
1223 | + throw new DropboxClientException("Path cannot be null."); |
|
1224 | + } |
|
1225 | + |
|
1226 | + //Make Dropbox File if target is specified |
|
1227 | + $dropboxFile = $dropboxFile ? $this->makeDropboxFile($dropboxFile, null, null, DropboxFile::MODE_WRITE) : null; |
|
1228 | + |
|
1229 | + //Download File |
|
1230 | + $response = $this->postToContent('/files/download_zip', ['path' => $path], null, $dropboxFile); |
|
1231 | + |
|
1232 | + //Get file metadata from response headers |
|
1233 | + $metadata = $this->getMetadataFromResponseHeaders($response); |
|
1234 | + |
|
1235 | + //File Contents |
|
1236 | + $contents = $dropboxFile ? $this->makeDropboxFile($dropboxFile) : $response->getBody(); |
|
1237 | + |
|
1238 | + //Make and return a File model |
|
1239 | + return new File($metadata, $contents); |
|
1240 | + } |
|
1241 | 1241 | |
1242 | 1242 | /** |
1243 | 1243 | * Get Current Account |