mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 10:27:45 +00:00 
			
		
		
		
	Use callback to get okhttp response
This commit is contained in:
		
							parent
							
								
									4968ca6e62
								
							
						
					
					
						commit
						e0e6d3da49
					
				| @ -175,8 +175,6 @@ public class OwnCloudClient extends HttpClient { | ||||
|         return status; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     public RedirectionPath followRedirection(HttpBaseMethod method) throws Exception { | ||||
|         int redirectionsCount = 0; | ||||
|         int status = method.getStatusCode(); | ||||
|  | ||||
| @ -24,7 +24,6 @@ | ||||
| 
 | ||||
| package com.owncloud.android.lib.common.http.methods.webdav; | ||||
| 
 | ||||
| import com.owncloud.android.lib.common.http.HttpClient; | ||||
| import com.owncloud.android.lib.common.http.methods.HttpBaseMethod; | ||||
| 
 | ||||
| import java.net.URL; | ||||
| @ -32,7 +31,6 @@ import java.util.concurrent.TimeUnit; | ||||
| 
 | ||||
| import at.bitfire.dav4android.Constants; | ||||
| import at.bitfire.dav4android.DavOCResource; | ||||
| import at.bitfire.dav4android.DavResource; | ||||
| import at.bitfire.dav4android.exception.RedirectException; | ||||
| import okhttp3.HttpUrl; | ||||
| 
 | ||||
| @ -61,8 +59,8 @@ public abstract class DavMethod extends HttpBaseMethod { | ||||
|     @Override | ||||
|     public int execute() throws Exception { | ||||
|         try { | ||||
|              return onExecute(); | ||||
|         } catch(RedirectException e) { | ||||
|             return onExecute(); | ||||
|         } catch (RedirectException e) { | ||||
|             return getStatusCode(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @ -28,6 +28,7 @@ import java.io.IOException; | ||||
| import java.net.URL; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import at.bitfire.dav4android.Property; | ||||
| import at.bitfire.dav4android.Response; | ||||
| import at.bitfire.dav4android.exception.DavException; | ||||
| @ -71,18 +72,17 @@ public class PropfindMethod extends DavMethod { | ||||
|                             case OTHER: | ||||
|                             default: | ||||
|                         } | ||||
| 
 | ||||
|                         return Unit.INSTANCE; | ||||
|             }, response -> { | ||||
|                 mResponse = response; | ||||
|                 return Unit.INSTANCE; | ||||
|             }); | ||||
|                     }, response -> { | ||||
|                         mResponse = response; | ||||
|                         return Unit.INSTANCE; | ||||
|                     }); | ||||
|         } catch (UnauthorizedException davException) { | ||||
|             // Do nothing, we will use the 401 code to handle the situation | ||||
|             return davException.getCode(); | ||||
|         } | ||||
| 
 | ||||
|         return super.getStatusCode(); | ||||
|         return getStatusCode(); | ||||
|     } | ||||
| 
 | ||||
|     public int getDepth() { | ||||
|  | ||||
| @ -77,7 +77,6 @@ public class ExistenceCheckRemoteOperation extends RemoteOperation { | ||||
|     @Override | ||||
|     protected RemoteOperationResult run(OwnCloudClient client) { | ||||
| 
 | ||||
| 
 | ||||
|         try { | ||||
|             client.setFollowRedirects(true); | ||||
|             PropfindMethod propfindMethod = new PropfindMethod( | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user