add Support for passing a FileInfo instance to View->putFileInfo
This commit is contained in:
parent
82762bb462
commit
e706cf6c06
|
@ -146,4 +146,8 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess, \JsonSerializable {
|
|||
public function getType() {
|
||||
return $this->data['type'];
|
||||
}
|
||||
|
||||
public function getData(){
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -963,12 +963,15 @@ class View {
|
|||
* change file metadata
|
||||
*
|
||||
* @param string $path
|
||||
* @param array $data
|
||||
* @param array | \OCP\Files\FileInfo $data
|
||||
* @return int
|
||||
*
|
||||
* returns the fileid of the updated file
|
||||
*/
|
||||
public function putFileInfo($path, $data) {
|
||||
if ($data instanceof FileInfo) {
|
||||
$data = $data->getData();
|
||||
}
|
||||
$path = Filesystem::normalizePath($this->fakeRoot . '/' . $path);
|
||||
/**
|
||||
* @var \OC\Files\Storage\Storage $storage
|
||||
|
|
Loading…
Reference in New Issue