*
*/
+import android.content.Intent;
+
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.network.OwnCloudClient;
private boolean mPublicUpload;
private String mPassword;
private int mPermissions;
+ private Intent mSendIntent;
/**
* Constructor
* For instance, for \93Re-Share\94, \93delete\94, \93read\94, \93update\94, add 16+8+2+1 = 27.
*/
public CreateShareOperation(String path, ShareType shareType, String shareWith, boolean publicUpload,
- String password, int permissions) {
+ String password, int permissions, Intent sendIntent) {
mPath = path;
mShareType = shareType;
mPublicUpload = publicUpload;
mPassword = password;
mPermissions = permissions;
+ mSendIntent = sendIntent;
}
@Override
// Update DB with the response
if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) {
share.setPath(mPath.substring(0, mPath.length()-1));
- share.setIsDirectory(true);
+ share.setIsFolder(true);
} else {
share.setPath(mPath);
- share.setIsDirectory(false);
+ share.setIsFolder(false);
}
share.setPermissions(mPermissions);
// Update OCFile with data from share: ShareByLink and publicLink
OCFile file = getStorageManager().getFileByPath(mPath);
if (file!=null) {
+ mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink());
file.setPublicLink(share.getShareLink());
+ file.setShareByLink(true);
getStorageManager().saveFile(file);
Log_OC.d(TAG, "Public Link = " + file.getPublicLink());
return result;
}
+
+
+ public Intent getSendIntent() {
+ return mSendIntent;
+ }
}