mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 10:27:45 +00:00 
			
		
		
		
	Renamed operation to get quota following scheme of rest of operations, and some clean-up
This commit is contained in:
		
							parent
							
								
									b8aa7b6119
								
							
						
					
					
						commit
						477a99e243
					
				| @ -43,7 +43,7 @@ import java.util.ArrayList; | ||||
| /** | ||||
|  * @author marcello | ||||
|  */ | ||||
| public class RemoteGetUserQuotaOperation extends RemoteOperation { | ||||
| public class GetRemoteUserQuotaOperation extends RemoteOperation { | ||||
| 
 | ||||
|     static public class Quota { | ||||
|         long mFree, mUsed, mTotal; | ||||
| @ -62,7 +62,7 @@ public class RemoteGetUserQuotaOperation extends RemoteOperation { | ||||
|         public double getRelative() { return mRelative; } | ||||
|     } | ||||
| 
 | ||||
|     private static final String TAG = RemoteGetUserQuotaOperation.class.getSimpleName(); | ||||
|     private static final String TAG = GetRemoteUserQuotaOperation.class.getSimpleName(); | ||||
| 
 | ||||
|     private static final String NODE_OCS = "ocs"; | ||||
|     private static final String NODE_DATA = "data"; | ||||
| @ -89,6 +89,7 @@ public class RemoteGetUserQuotaOperation extends RemoteOperation { | ||||
| 
 | ||||
|             get = new GetMethod(url); | ||||
|             get.setQueryString(new NameValuePair[]{new NameValuePair("format","json")}); | ||||
|             get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE); | ||||
|             status = client.executeMethod(get); | ||||
| 
 | ||||
|             if(isSuccess(status)) { | ||||
| @ -58,7 +58,7 @@ import com.owncloud.android.lib.resources.shares.CreateRemoteShareOperation; | ||||
| import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation; | ||||
| import com.owncloud.android.lib.resources.shares.RemoveRemoteShareOperation; | ||||
| import com.owncloud.android.lib.resources.shares.ShareType; | ||||
| import com.owncloud.android.lib.resources.users.RemoteGetUserQuotaOperation; | ||||
| import com.owncloud.android.lib.resources.users.GetRemoteUserQuotaOperation; | ||||
| 
 | ||||
| /** | ||||
|  * Activity to test OC framework | ||||
| @ -334,7 +334,7 @@ public class TestActivity extends Activity { | ||||
| 	} | ||||
| 
 | ||||
|     public RemoteOperationResult getQuota() { | ||||
|         RemoteGetUserQuotaOperation getUserQuotaOperation = new RemoteGetUserQuotaOperation(); | ||||
|         GetRemoteUserQuotaOperation getUserQuotaOperation = new GetRemoteUserQuotaOperation(); | ||||
|         return getUserQuotaOperation.execute(mClient); | ||||
|     } | ||||
| 	 | ||||
|  | ||||
| @ -26,36 +26,24 @@ | ||||
| 
 | ||||
| package com.owncloud.android.lib.test_project.test; | ||||
| 
 | ||||
| import java.io.File; | ||||
| import java.util.*; | ||||
| 
 | ||||
| import com.owncloud.android.lib.common.operations.RemoteOperationResult; | ||||
| import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; | ||||
| import com.owncloud.android.lib.resources.users.RemoteGetUserQuotaOperation.Quota; | ||||
| import com.owncloud.android.lib.resources.users.GetRemoteUserQuotaOperation.Quota; | ||||
| import com.owncloud.android.lib.test_project.TestActivity; | ||||
| import com.owncloud.android.lib.resources.files.*; | ||||
| 
 | ||||
| 
 | ||||
| /** | ||||
|  * Class to test Get User Quota | ||||
|  * | ||||
|  * @author Bartosz Przybylski | ||||
|  * | ||||
|  * @author David A. Velasco | ||||
|  */ | ||||
| public class GetUserQuotaTest extends RemoteTest { | ||||
| 
 | ||||
| 
 | ||||
|     private static final String LOG_TAG = GetUserQuotaTest.class.getCanonicalName(); | ||||
| 
 | ||||
|     /* Files to download. These files must exist on the account */ | ||||
|     private static final String IMAGE_PATH = "/fileToDownload.png"; | ||||
|     private static final String IMAGE_PATH_WITH_SPECIAL_CHARS = "/@file@download.png"; | ||||
|     private static final String IMAGE_NOT_FOUND = "/fileNotFound.png"; | ||||
| 
 | ||||
|     private String mFullPath2Image; | ||||
|     private String mFullPath2ImageWitSpecialChars; | ||||
|     private String mFullPath2ImageNotFound; | ||||
|     private String mDownloadedFilePath; | ||||
|     private TestActivity mActivity; | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user