@@ -67,7 +67,7 @@ public function __construct(array $parameters) {
6767 $ this ->logger = \OCP \Server::get (LoggerInterface::class);
6868 }
6969
70- public function mkdir (string $ path , bool $ force = false ): bool {
70+ public function mkdir (string $ path , bool $ force = false , array $ metadata = [] ): bool {
7171 $ path = $ this ->normalizePath ($ path );
7272 if (!$ force && $ this ->file_exists ($ path )) {
7373 $ this ->logger ->warning ("Tried to create an object store folder that already exists: $ path " );
@@ -77,7 +77,7 @@ public function mkdir(string $path, bool $force = false): bool {
7777 $ mTime = time ();
7878 $ data = [
7979 'mimetype ' => 'httpd/unix-directory ' ,
80- 'size ' => 0 ,
80+ 'size ' => $ metadata [ ' size ' ] ?? 0 ,
8181 'mtime ' => $ mTime ,
8282 'storage_mtime ' => $ mTime ,
8383 'permissions ' => \OCP \Constants::PERMISSION_ALL ,
@@ -709,7 +709,7 @@ private function copyInner(ICache $sourceCache, ICacheEntry $sourceEntry, string
709709 if ($ cache ->inCache ($ to )) {
710710 $ cache ->remove ($ to );
711711 }
712- $ this ->mkdir ($ to );
712+ $ this ->mkdir ($ to, false , [ ' size ' => $ sourceEntry -> getSize ()] );
713713
714714 foreach ($ sourceCache ->getFolderContentsById ($ sourceEntry ->getId ()) as $ child ) {
715715 $ this ->copyInner ($ sourceCache , $ child , $ to . '/ ' . $ child ->getName ());
0 commit comments