mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Code Review changes done
This commit is contained in:
parent
c6a82c0a87
commit
f8f4c1ed43
4 changed files with 13 additions and 12 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 4d524100d5441610e8f5999aff4acdd129885df4
|
||||
Subproject commit 996660b88c4e2b3cef08604963cf2c29491efa1b
|
|
@ -60,7 +60,8 @@ public class CreateShareWithShareeOperation extends SyncOperation {
|
|||
* https://doc.owncloud.org/server/8.2/developer_manual/core/ocs-share-api.html .
|
||||
*/
|
||||
public CreateShareWithShareeOperation(String path, String shareeName, ShareType shareType, int permissions) {
|
||||
if (!ShareType.USER.equals(shareType) && !ShareType.GROUP.equals(shareType) && !ShareType.FEDERATED.equals(shareType)) {
|
||||
if (!ShareType.USER.equals(shareType) && !ShareType.GROUP.equals(shareType)
|
||||
&& !ShareType.FEDERATED.equals(shareType)) {
|
||||
throw new IllegalArgumentException("Illegal share type " + shareType);
|
||||
}
|
||||
mPath = path;
|
||||
|
|
|
@ -78,7 +78,8 @@ public class UnshareOperation extends SyncOperation {
|
|||
if (ShareType.PUBLIC_LINK.equals(mShareType)) {
|
||||
file.setShareViaLink(false);
|
||||
file.setPublicLink("");
|
||||
} else if (ShareType.USER.equals(mShareType) || ShareType.GROUP.equals(mShareType) || ShareType.FEDERATED.equals(mShareType)){
|
||||
} else if (ShareType.USER.equals(mShareType) || ShareType.GROUP.equals(mShareType)
|
||||
|| ShareType.FEDERATED.equals(mShareType)){
|
||||
// Check if it is the last share
|
||||
ArrayList <OCShare> sharesWith = getStorageManager().
|
||||
getSharesWithForAFile(mRemotePath,
|
||||
|
|
|
@ -93,10 +93,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
|
|||
|
||||
public static ShareType getShareType(String authority) {
|
||||
|
||||
if (sShareTypes.containsKey(authority)) {
|
||||
return sShareTypes.get(authority);
|
||||
}
|
||||
return null;
|
||||
return sShareTypes.get(authority);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -200,8 +197,9 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
|
|||
if (userName.equals(shareWith)) {
|
||||
displayName = getContext().getString(R.string.share_remote_clarification, userName);
|
||||
} else {
|
||||
String[] uriSplitted = shareWith.split("@");
|
||||
displayName = getContext().getString(R.string.share_known_remote_clarification, userName,
|
||||
shareWith.split("@")[1]);
|
||||
uriSplitted[uriSplitted.length - 1]);
|
||||
}
|
||||
dataUri = Uri.withAppendedPath(remoteBaseUri, shareWith);
|
||||
} else if (ShareType.USER.getValue() == type) {
|
||||
|
@ -209,11 +207,12 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
|
|||
dataUri = Uri.withAppendedPath(userBaseUri, shareWith);
|
||||
}
|
||||
|
||||
if (displayName != null && dataUri != null)
|
||||
if (displayName != null && dataUri != null) {
|
||||
response.newRow()
|
||||
.add(count++) // BaseColumns._ID
|
||||
.add(displayName) // SearchManager.SUGGEST_COLUMN_TEXT_1
|
||||
.add(dataUri);
|
||||
.add(count++) // BaseColumns._ID
|
||||
.add(displayName) // SearchManager.SUGGEST_COLUMN_TEXT_1
|
||||
.add(dataUri);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
|
|
Loading…
Reference in a new issue