Store FileInfo::getType() result for future use
This commit is contained in:
parent
44c330aa5d
commit
a79757bc37
|
@ -159,11 +159,10 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
||||||
* @return \OCP\Files\FileInfo::TYPE_FILE|\OCP\Files\FileInfo::TYPE_FOLDER
|
* @return \OCP\Files\FileInfo::TYPE_FILE|\OCP\Files\FileInfo::TYPE_FOLDER
|
||||||
*/
|
*/
|
||||||
public function getType() {
|
public function getType() {
|
||||||
if (isset($this->data['type'])) {
|
if (!isset($this->data['type'])) {
|
||||||
return $this->data['type'];
|
$this->data['type'] = ($this->getMimetype() === 'httpd/unix-directory') ? self::TYPE_FOLDER : self::TYPE_FILE;
|
||||||
} else {
|
|
||||||
return $this->getMimetype() === 'httpd/unix-directory' ? self::TYPE_FOLDER : self::TYPE_FILE;
|
|
||||||
}
|
}
|
||||||
|
return $this->data['type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getData() {
|
public function getData() {
|
||||||
|
|
Loading…
Reference in New Issue