$list = $this->client->nlist($this->abs_path($path));
$id = md5('sftp:' . $path);
- OC_FakeDirStream::$dirs[$id] = array();
+ $dir_stream = array();
foreach($list as $file) {
if ($file != '.' && $file != '..') {
- OC_FakeDirStream::$dirs[$id][] = $file;
+ $dir_stream[] = $file;
}
}
+ \OC\Files\Stream\Dir::register($id, $dir_stream);
return opendir('fakedir://' . $id);
} catch(Exception $e) {
return false;
$ext='';
}
$tmpFile=OC_Helper::tmpFile($ext);
- OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
+ \OC\Files\Stream\Close::registerCallback($tmpFile], array($this, 'writeBack'));
if ($this->file_exists($path)) {
$this->getFile($abs_path, $tmpFile);
}