@@ -235,7 +235,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
235235
236236        if  (mLocalFolder  == null ) {
237237            Log_OC .e (TAG , "Local folder is null, cannot run refresh folder operation" );
238-             return  new  RemoteOperationResult (ResultCode .FILE_NOT_FOUND );
238+             return  new  RemoteOperationResult <> (ResultCode .FILE_NOT_FOUND );
239239        }
240240
241241        if  (OCFile .ROOT_PATH .equals (mLocalFolder .getRemotePath ()) && !mSyncFullAccount  && !mOnlyFileMetadata ) {
@@ -265,7 +265,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
265265                fileDataStorageManager .saveFile (mLocalFolder );
266266            } else  {
267267                Log_OC .e (TAG , "Local folder is null, cannot set last sync date nor save file" );
268-                 result  = new  RemoteOperationResult (ResultCode .FILE_NOT_FOUND );
268+                 result  = new  RemoteOperationResult <> (ResultCode .FILE_NOT_FOUND );
269269            }
270270        }
271271
@@ -275,8 +275,16 @@ protected RemoteOperationResult run(OwnCloudClient client) {
275275            sendLocalBroadcast (EVENT_SINGLE_FOLDER_CONTENTS_SYNCED , mLocalFolder .getRemotePath (), result );
276276        }
277277
278-         if  (result .isSuccess () && !mSyncFullAccount  && !mOnlyFileMetadata  && mLocalFolder  != null ) {
279-             refreshSharesForFolder (client ); // share result is ignored 
278+         if  (result .isSuccess () && result .getData () != null  && !mSyncFullAccount  && !mOnlyFileMetadata ) {
279+             final  var  remoteObject  = result .getData ();
280+             final  ArrayList <RemoteFile > remoteFiles  = new  ArrayList <>();
281+             for  (Object  object : remoteObject ) {
282+                 if  (object  instanceof  RemoteFile  remoteFile ) {
283+                     remoteFiles .add (remoteFile );
284+                 }
285+             }
286+ 
287+             fileDataStorageManager .saveSharesFromRemoteFile (remoteFiles );
280288        }
281289
282290        if  (!mSyncFullAccount  && mLocalFolder  != null ) {
@@ -814,18 +822,6 @@ private void startContentSynchronizations(List<SynchronizeFileOperation> filesTo
814822        }
815823    }
816824
817-     /** 
818-      * Syncs the Share resources for the files contained in the folder refreshed (children, not deeper descendants). 
819-      * 
820-      * 
821-      * fetch in the details only for one file 
822-      * @param client Handler of a session with an OC server. 
823-      */ 
824-     private  void  refreshSharesForFolder (OwnCloudClient  client ) {
825-         GetSharesForFileOperation  operation  = new  GetSharesForFileOperation (mLocalFolder .getRemotePath (), true , true , fileDataStorageManager );
826-         operation .execute (client );
827-     }
828- 
829825    /** 
830826     * Sends a message to any application component interested in the progress of the synchronization. 
831827     * 
0 commit comments