summaryrefslogtreecommitdiffstats
path: root/lib/private/Avatar.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-07 16:09:22 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-10-05 11:00:16 +0200
commit6807cb684f64587f1747b5168eb42e5172c889eb (patch)
tree8cd20e87f28693c1c4d2dc44ea9c6c43f597ceeb /lib/private/Avatar.php
parentac38a3a654df909d2c0c9d7c4d84e8e5ea2c587a (diff)
downloadnextcloud-server-6807cb684f64587f1747b5168eb42e5172c889eb.tar.gz
nextcloud-server-6807cb684f64587f1747b5168eb42e5172c889eb.zip
avatar to appdata
* Fix AvatarTest Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Avatar.php')
-rw-r--r--lib/private/Avatar.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/private/Avatar.php b/lib/private/Avatar.php
index e7fd4da4615..c3a068701df 100644
--- a/lib/private/Avatar.php
+++ b/lib/private/Avatar.php
@@ -29,10 +29,9 @@
namespace OC;
use OC\User\User;
-use OCP\Files\Folder;
-use OCP\Files\File;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
+use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\IAvatar;
use OCP\IConfig;
@@ -99,7 +98,8 @@ class Avatar implements IAvatar {
* @return bool
*/
public function exists() {
- return $this->folder->nodeExists('avatar.jpg') || $this->folder->nodeExists('avatar.png');
+
+ return $this->folder->fileExists('avatar.jpg') || $this->folder->fileExists('avatar.png');
}
/**
@@ -171,15 +171,15 @@ class Avatar implements IAvatar {
}
try {
- $file = $this->folder->get($path);
+ $file = $this->folder->getFile($path);
} catch (NotFoundException $e) {
if ($size <= 0) {
throw new NotFoundException;
}
$avatar = new OC_Image();
- /** @var File $file */
- $file = $this->folder->get('avatar.' . $ext);
+ /** @var ISimpleFile $file */
+ $file = $this->folder->getFile('avatar.' . $ext);
$avatar->loadFromData($file->getContent());
if ($size !== -1) {
$avatar->resize($size);
@@ -202,9 +202,9 @@ class Avatar implements IAvatar {
* @throws NotFoundException
*/
private function getExtension() {
- if ($this->folder->nodeExists('avatar.jpg')) {
+ if ($this->folder->fileExists('avatar.jpg')) {
return 'jpg';
- } elseif ($this->folder->nodeExists('avatar.png')) {
+ } elseif ($this->folder->fileExists('avatar.png')) {
return 'png';
}
throw new NotFoundException;