mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	Merge pull request #577 from owncloud/feature/respect_app_provider_values_from_capabilities
[FEATURE REQUEST] Respect app_provider values from capabilities
This commit is contained in:
		
						commit
						8eb435a1c2
					
				| @ -37,14 +37,14 @@ import com.squareup.moshi.Moshi | ||||
| import timber.log.Timber | ||||
| import java.net.URL | ||||
| 
 | ||||
| class GetRemoteAppRegistryOperation : RemoteOperation<AppRegistryResponse>() { | ||||
| class GetRemoteAppRegistryOperation(private val appUrl: String?) : RemoteOperation<AppRegistryResponse>() { | ||||
| 
 | ||||
|     override fun run(client: OwnCloudClient): RemoteOperationResult<AppRegistryResponse> { | ||||
|         var result: RemoteOperationResult<AppRegistryResponse> | ||||
| 
 | ||||
|         try { | ||||
|             val uriBuilder = client.baseUri.buildUpon().apply { | ||||
|                 appendEncodedPath(APP_REGISTRY_ENDPOINT) | ||||
|                 appendEncodedPath(appUrl) | ||||
|             } | ||||
|             val getMethod = GetMethod(URL(uriBuilder.build().toString())) | ||||
|             val status = client.executeHttpMethod(getMethod) | ||||
| @ -75,8 +75,4 @@ class GetRemoteAppRegistryOperation : RemoteOperation<AppRegistryResponse>() { | ||||
| 
 | ||||
|         return result | ||||
|     } | ||||
| 
 | ||||
|     companion object { | ||||
|         private const val APP_REGISTRY_ENDPOINT = "app/list" | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -28,7 +28,7 @@ import com.owncloud.android.lib.resources.Service | ||||
| import com.owncloud.android.lib.resources.appregistry.responses.AppRegistryResponse | ||||
| 
 | ||||
| interface AppRegistryService : Service { | ||||
|     fun getAppRegistry(): RemoteOperationResult<AppRegistryResponse> | ||||
|     fun getAppRegistry(appUrl: String?): RemoteOperationResult<AppRegistryResponse> | ||||
| 
 | ||||
|     fun getUrlToOpenInWeb( | ||||
|         openWebEndpoint: String, | ||||
|  | ||||
| @ -31,8 +31,8 @@ import com.owncloud.android.lib.resources.appregistry.GetUrlToOpenInWebRemoteOpe | ||||
| import com.owncloud.android.lib.resources.appregistry.responses.AppRegistryResponse | ||||
| 
 | ||||
| class OCAppRegistryService(override val client: OwnCloudClient) : AppRegistryService { | ||||
|     override fun getAppRegistry(): RemoteOperationResult<AppRegistryResponse> = | ||||
|         GetRemoteAppRegistryOperation().execute(client) | ||||
|     override fun getAppRegistry(appUrl: String?): RemoteOperationResult<AppRegistryResponse> = | ||||
|         GetRemoteAppRegistryOperation(appUrl).execute(client) | ||||
| 
 | ||||
|     override fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String, appName: String): RemoteOperationResult<String> = | ||||
|         GetUrlToOpenInWebRemoteOperation( | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user