public boolean fileShareExists(String path) {
return fileShareExists(ProviderTableMeta.OCSHARES_PATH, path);
}
+
+ public void cleanShareFile() {
+ ContentValues cv = new ContentValues();
+ cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, false);
+ cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
+ String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
+ String [] whereArgs = new String[]{mAccount.name};
+
+ if (getContentResolver() != null) {
+ getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
+
+ } else {
+ try {
+ getContentProviderClient().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
+
+ } catch (RemoteException e) {
+ Log_OC.e(TAG, "Exception in cleanShareFile" + e.getMessage());
+ }
+ }
+ }
}
mLastSyncDateForProperties = source.readLong();
mLastSyncDateForData = source.readLong();
mEtag = source.readString();
- mShareByLink = source.readInt() == 0;
+ mShareByLink = source.readInt() == 1;
mPublicLink = source.readString();
}
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.OCShare;
import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
import com.owncloud.android.oc_framework.operations.RemoteOperation;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
import com.owncloud.android.oc_framework.operations.ShareRemoteFile;
if (result.isSuccess()) {
+ // Clean Share data in filelist table
+ mStorageManager.cleanShareFile();
// Update DB with the response
ArrayList<ShareRemoteFile> shareRemoteFiles = operation.getSharedFiles();
Log_OC.d(TAG, "Share list size = " + shareRemoteFiles.size());
private void onGetSharedFilesOperationFinish(GetSharedFilesOperation operation, RemoteOperationResult result) {
// TODO
// Refresh the filelist with the information
- refeshListOfFilesFragment();
-// OCFileListFragment fileListFragment = getListOfFilesFragment();
-// if (fileListFragment != null) {
-// fileListFragment.listDirectory(getCurrentDir());
-// }
+ refeshListOfFilesFragment();
}