mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	Remove the share type constants from GetRemoteShareesOperation
This commit is contained in:
		
							parent
							
								
									36da2a2336
								
							
						
					
					
						commit
						b13e584ac3
					
				| @ -93,10 +93,6 @@ public class GetRemoteShareesOperation extends RemoteOperation{ | |||||||
|     public static final String PROPERTY_SHARE_TYPE = "shareType"; |     public static final String PROPERTY_SHARE_TYPE = "shareType"; | ||||||
|     public static final String PROPERTY_SHARE_WITH = "shareWith"; |     public static final String PROPERTY_SHARE_WITH = "shareWith"; | ||||||
| 
 | 
 | ||||||
|     // Result types |  | ||||||
|     public static final Byte USER_TYPE = 0; |  | ||||||
|     public static final Byte GROUP_TYPE = 1; |  | ||||||
| 
 |  | ||||||
|     private String mSearchString; |     private String mSearchString; | ||||||
|     private int mPage; |     private int mPage; | ||||||
|     private int mPerPage; |     private int mPerPage; | ||||||
|  | |||||||
| @ -41,6 +41,7 @@ import com.owncloud.android.lib.common.OwnCloudCredentialsFactory; | |||||||
| import com.owncloud.android.lib.common.network.NetworkUtils; | import com.owncloud.android.lib.common.network.NetworkUtils; | ||||||
| import com.owncloud.android.lib.common.operations.RemoteOperationResult; | import com.owncloud.android.lib.common.operations.RemoteOperationResult; | ||||||
| import com.owncloud.android.lib.resources.shares.GetRemoteShareesOperation; | import com.owncloud.android.lib.resources.shares.GetRemoteShareesOperation; | ||||||
|  | import com.owncloud.android.lib.resources.shares.ShareType; | ||||||
| import com.owncloud.android.lib.test_project.R; | import com.owncloud.android.lib.test_project.R; | ||||||
| import com.owncloud.android.lib.test_project.SelfSignedConfidentSslSocketFactory; | import com.owncloud.android.lib.test_project.SelfSignedConfidentSslSocketFactory; | ||||||
| 
 | 
 | ||||||
| @ -125,15 +126,15 @@ public class GetShareesTest extends RemoteTest { | |||||||
| 		RemoteOperationResult result = getShareesOperation.execute(mClient); | 		RemoteOperationResult result = getShareesOperation.execute(mClient); | ||||||
| 		JSONObject resultItem; | 		JSONObject resultItem; | ||||||
| 		JSONObject value; | 		JSONObject value; | ||||||
| 		byte type; | 		int type; | ||||||
| 		int userCount = 0, groupCount = 0; | 		int userCount = 0, groupCount = 0; | ||||||
| 		assertTrue(result.isSuccess() && result.getData().size() > 0); | 		assertTrue(result.isSuccess() && result.getData().size() > 0); | ||||||
| 		try { | 		try { | ||||||
| 			for (int i=0; i<result.getData().size(); i++) { | 			for (int i=0; i<result.getData().size(); i++) { | ||||||
| 				resultItem = (JSONObject) result.getData().get(i); | 				resultItem = (JSONObject) result.getData().get(i); | ||||||
| 	            value = resultItem.getJSONObject(GetRemoteShareesOperation.NODE_VALUE); | 	            value = resultItem.getJSONObject(GetRemoteShareesOperation.NODE_VALUE); | ||||||
| 	            type = (byte) value.getInt(GetRemoteShareesOperation.PROPERTY_SHARE_TYPE); | 	            type = value.getInt(GetRemoteShareesOperation.PROPERTY_SHARE_TYPE); | ||||||
| 				if (GetRemoteShareesOperation.GROUP_TYPE.equals(type)) { | 				if (type == ShareType.GROUP) { | ||||||
| 					groupCount++; | 					groupCount++; | ||||||
| 				} else { | 				} else { | ||||||
| 					userCount++; | 					userCount++; | ||||||
| @ -156,8 +157,8 @@ public class GetShareesTest extends RemoteTest { | |||||||
| 			for (int i=0; i<2; i++) { | 			for (int i=0; i<2; i++) { | ||||||
| 				resultItem = (JSONObject) result.getData().get(i); | 				resultItem = (JSONObject) result.getData().get(i); | ||||||
| 	            value = resultItem.getJSONObject(GetRemoteShareesOperation.NODE_VALUE); | 	            value = resultItem.getJSONObject(GetRemoteShareesOperation.NODE_VALUE); | ||||||
| 	            type = (byte) value.getInt(GetRemoteShareesOperation.PROPERTY_SHARE_TYPE); | 	            type = value.getInt(GetRemoteShareesOperation.PROPERTY_SHARE_TYPE); | ||||||
| 				if (GetRemoteShareesOperation.GROUP_TYPE.equals(type)) { | 				if (type == ShareType.GROUP) { | ||||||
| 					groupCount++; | 					groupCount++; | ||||||
| 				} else { | 				} else { | ||||||
| 					userCount++; | 					userCount++; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user