Fix FileInfo->getType

This commit is contained in:
Robin Appelman 2014-03-03 13:51:49 +01:00
parent 3a21755963
commit 9231195c98
2 changed files with 7 additions and 3 deletions

View File

@ -144,10 +144,14 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return \OCP\Files\FileInfo::TYPE_FILE | \OCP\Files\FileInfo::TYPE_FOLDER
*/
public function getType() {
return $this->data['type'];
if ($this->data['type']) {
return $this->data['type'];
} else {
return $this->getMimetype() === 'httpd/unix-directory' ? self::TYPE_FOLDER : self::TYPE_FILE;
}
}
public function getData(){
public function getData() {
return $this->data;
}

View File

@ -9,7 +9,7 @@ namespace OCP\Files;
interface FileInfo {
const TYPE_FILE = 'file';
const TYPE_FOLDER = 'folder';
const TYPE_FOLDER = 'dir';
/**
* Get the Etag of the file or folder