mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-28 17:07:49 +00:00 
			
		
		
		
	Merge branch 'develop' into check_server_certificates_in_SSO_webview
This commit is contained in:
		
						commit
						268681dbff
					
				| @ -55,6 +55,12 @@ public abstract class RemoteOperation implements Runnable { | |||||||
| 	 | 	 | ||||||
|     private static final String TAG = RemoteOperation.class.getSimpleName(); |     private static final String TAG = RemoteOperation.class.getSimpleName(); | ||||||
| 
 | 
 | ||||||
|  |     /** OCS API header name */ | ||||||
|  |     public static final String OCS_API_HEADER = "OCS-APIREQUEST"; | ||||||
|  | 
 | ||||||
|  |     /** OCS API header value */ | ||||||
|  |     public static final String OCS_API_HEADER_VALUE = "true"; | ||||||
|  | 
 | ||||||
|     /** ownCloud account in the remote ownCloud server to operate */ |     /** ownCloud account in the remote ownCloud server to operate */ | ||||||
|     private Account mAccount = null; |     private Account mAccount = null; | ||||||
|      |      | ||||||
|  | |||||||
| @ -115,6 +115,8 @@ public class CreateRemoteShareOperation extends RemoteOperation { | |||||||
| 			} | 			} | ||||||
| 			post.addParameter(PARAM_PERMISSIONS, Integer.toString(mPermissions)); | 			post.addParameter(PARAM_PERMISSIONS, Integer.toString(mPermissions)); | ||||||
| 
 | 
 | ||||||
|  | 			post.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE); | ||||||
|  |              | ||||||
| 			status = client.executeMethod(post); | 			status = client.executeMethod(post); | ||||||
| 
 | 
 | ||||||
| 			if(isSuccess(status)) { | 			if(isSuccess(status)) { | ||||||
|  | |||||||
| @ -96,6 +96,8 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation { | |||||||
| 				    new NameValuePair(PARAM_SUBFILES, String.valueOf(mSubfiles)) | 				    new NameValuePair(PARAM_SUBFILES, String.valueOf(mSubfiles)) | ||||||
| 				});  | 				});  | ||||||
| 
 | 
 | ||||||
|  | 			get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE); | ||||||
|  |              | ||||||
| 			status = client.executeMethod(get); | 			status = client.executeMethod(get); | ||||||
| 
 | 
 | ||||||
| 			if(isSuccess(status)) { | 			if(isSuccess(status)) { | ||||||
|  | |||||||
| @ -68,6 +68,7 @@ public class GetRemoteSharesOperation extends RemoteOperation { | |||||||
| 		try{ | 		try{ | ||||||
| 			get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH); | 			get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH); | ||||||
| 			Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH); | 			Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH); | ||||||
|  | 			get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE); | ||||||
| 			status = client.executeMethod(get); | 			status = client.executeMethod(get); | ||||||
| 			if(isSuccess(status)) { | 			if(isSuccess(status)) { | ||||||
| 				Log.d(TAG, "Obtain RESPONSE"); | 				Log.d(TAG, "Obtain RESPONSE"); | ||||||
|  | |||||||
| @ -73,6 +73,8 @@ public class RemoveRemoteShareOperation extends RemoteOperation { | |||||||
| 			delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH + id); | 			delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH + id); | ||||||
| 			Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH + id); | 			Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH + id); | ||||||
| 
 | 
 | ||||||
|  | 			delete.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE); | ||||||
|  |              | ||||||
| 			status = client.executeMethod(delete); | 			status = client.executeMethod(delete); | ||||||
| 
 | 
 | ||||||
| 			if(isSuccess(status)) { | 			if(isSuccess(status)) { | ||||||
|  | |||||||
| @ -48,10 +48,6 @@ public class GetRemoteUserNameOperation extends RemoteOperation { | |||||||
| 	 | 	 | ||||||
| 	private static final String TAG = GetRemoteUserNameOperation.class.getSimpleName(); | 	private static final String TAG = GetRemoteUserNameOperation.class.getSimpleName(); | ||||||
| 
 | 
 | ||||||
| 	// HEADER |  | ||||||
| 	private static final String HEADER_OCS_API = "OCS-APIREQUEST"; |  | ||||||
| 	private static final String HEADER_OCS_API_VALUE = "true"; |  | ||||||
| 
 |  | ||||||
| 	// OCS Route | 	// OCS Route | ||||||
| 	private static final String OCS_ROUTE ="/index.php/ocs/cloud/user?format=json";  | 	private static final String OCS_ROUTE ="/index.php/ocs/cloud/user?format=json";  | ||||||
| 
 | 
 | ||||||
| @ -74,18 +70,14 @@ public class GetRemoteUserNameOperation extends RemoteOperation { | |||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	protected RemoteOperationResult run(OwnCloudClient client) { | 	protected RemoteOperationResult run(OwnCloudClient client) { | ||||||
|         RemoteOperationResult result = null; | 		RemoteOperationResult result = null; | ||||||
|         int status = -1; | 		int status = -1; | ||||||
|         GetMethod get = null; | 		GetMethod get = null; | ||||||
|          | 
 | ||||||
|         //Get the user | 		//Get the user | ||||||
|         try { | 		try { | ||||||
|             get = new GetMethod(client.getWebdavUri() + OCS_ROUTE); | 			get = new GetMethod(client.getWebdavUri() + OCS_ROUTE); | ||||||
|             //get = new GetMethod(client.getBaseUri() + OCS_ROUTE);	// need to fix the semantics of getBaseUri and getWebdavUri | 			get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE); | ||||||
|             //Log.e(TAG, "Getting OC user information from " + client.getBaseUri() + OCS_ROUTE); |  | ||||||
|             //Log.e(TAG, "Getting OC user information from " + client.getWebdavUri() + OCS_ROUTE); |  | ||||||
|             // Add the Header |  | ||||||
|             get.addRequestHeader(HEADER_OCS_API, HEADER_OCS_API_VALUE); |  | ||||||
| 			status = client.executeMethod(get); | 			status = client.executeMethod(get); | ||||||
| 			if(isSuccess(status)) { | 			if(isSuccess(status)) { | ||||||
| 				 String response = get.getResponseBodyAsString(); | 				 String response = get.getResponseBodyAsString(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user