summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/google.php
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-08-18 22:49:29 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-08-19 15:26:38 +0100
commitd577aad4ac876c1ed29f7b81199f607da581239b (patch)
tree55bca408402528a7fff2e4d5a0acb5aa7e4ee534 /apps/files_external/lib/google.php
parent5fd36d017ecdbce61dcf1c67ae04c8c0be81a4bf (diff)
downloadnextcloud-server-d577aad4ac876c1ed29f7b81199f607da581239b.tar.gz
nextcloud-server-d577aad4ac876c1ed29f7b81199f607da581239b.zip
Use OCP classes as much as possible in files_external
Diffstat (limited to 'apps/files_external/lib/google.php')
-rw-r--r--apps/files_external/lib/google.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 2ca550dfe7c..e29b1036244 100644
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -429,7 +429,7 @@ class Google extends \OC\Files\Storage\Common {
$request = new \Google_Http_Request($downloadUrl, 'GET', null, null);
$httpRequest = $this->client->getAuth()->authenticatedRequest($request);
if ($httpRequest->getResponseHttpCode() == 200) {
- $tmpFile = \OC_Helper::tmpFile($ext);
+ $tmpFile = \OCP\Files::tmpFile($ext);
$data = $httpRequest->getResponseBody();
file_put_contents($tmpFile, $data);
return fopen($tmpFile, $mode);
@@ -449,7 +449,7 @@ class Google extends \OC\Files\Storage\Common {
case 'x+':
case 'c':
case 'c+':
- $tmpFile = \OC_Helper::tmpFile($ext);
+ $tmpFile = \OCP\Files::tmpFile($ext);
\OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack'));
if ($this->file_exists($path)) {
$source = $this->fopen($path, 'rb');
@@ -466,7 +466,7 @@ class Google extends \OC\Files\Storage\Common {
$parentFolder = $this->getDriveFile(dirname($path));
if ($parentFolder) {
// TODO Research resumable upload
- $mimetype = \OC_Helper::getMimeType($tmpFile);
+ $mimetype = \OC::$server->getMimeTypeDetector()->detect($tmpFile);
$data = file_get_contents($tmpFile);
$params = array(
'data' => $data,