use OCP\Files\NotPermittedException;
use OCP\IRequest;
use ownCloud\TarStreamer\TarStreamer;
+use Psr\Log\LoggerInterface;
use ZipStreamer\ZipStreamer;
class Streamer {
$dirNode = $userFolder->get($dir);
$files = $dirNode->getDirectoryListing();
+ /** @var LoggerInterface $logger */
+ $logger = \OC::$server->query(LoggerInterface::class);
foreach ($files as $file) {
if ($file instanceof File) {
try {
$fh = $file->fopen('r');
+ if ($fh === false) {
+ $logger->error('Unable to open file for stream: ' . print_r($file, true));
+ continue;
+ }
} catch (NotPermittedException $e) {
continue;
}