diff --git a/src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java b/src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java index 27cb60e0b0..e0c9039a43 100644 --- a/src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java +++ b/src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java @@ -1,18 +1,18 @@ -/** +/* * ownCloud Android client application * * @author David A. Velasco * Copyright (C) 2015 ownCloud Inc. - *

+ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * as published by the Free Software Foundation. - *

+ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - *

+ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -39,6 +39,7 @@ import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation; import com.owncloud.android.lib.resources.files.RemoteFile; import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation; import com.owncloud.android.lib.resources.shares.OCShare; +import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.syncadapter.FileSyncAdapter; import com.owncloud.android.utils.DataHolderUtil; import com.owncloud.android.utils.EncryptionUtils; @@ -550,8 +551,13 @@ public class RefreshFolderOperation extends RemoteOperation { if (result.isSuccess()) { // update local database ArrayList shares = new ArrayList<>(); + OCShare share; for (Object obj : result.getData()) { - shares.add((OCShare) obj); + share = (OCShare) obj; + + if (!ShareType.NO_SHARED.equals(share.getShareType())) { + shares.add(share); + } } mStorageManager.saveSharesInFolder(shares, mLocalFolder); }