diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/GetRemoteAppRegistryOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/GetRemoteAppRegistryOperation.kt index 60367ff0..e8ea864a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/GetRemoteAppRegistryOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/GetRemoteAppRegistryOperation.kt @@ -37,14 +37,14 @@ import com.squareup.moshi.Moshi import timber.log.Timber import java.net.URL -class GetRemoteAppRegistryOperation : RemoteOperation() { +class GetRemoteAppRegistryOperation(private val appUrl: String?) : RemoteOperation() { override fun run(client: OwnCloudClient): RemoteOperationResult { var result: RemoteOperationResult 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() { return result } - - companion object { - private const val APP_REGISTRY_ENDPOINT = "app/list" - } } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/services/AppRegistryService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/services/AppRegistryService.kt index 50145892..789129bd 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/services/AppRegistryService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/services/AppRegistryService.kt @@ -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 + fun getAppRegistry(appUrl: String?): RemoteOperationResult fun getUrlToOpenInWeb( openWebEndpoint: String, diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/services/OCAppRegistryService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/services/OCAppRegistryService.kt index e07ac100..34693103 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/services/OCAppRegistryService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/appregistry/services/OCAppRegistryService.kt @@ -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 = - GetRemoteAppRegistryOperation().execute(client) + override fun getAppRegistry(appUrl: String?): RemoteOperationResult = + GetRemoteAppRegistryOperation(appUrl).execute(client) override fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String, appName: String): RemoteOperationResult = GetUrlToOpenInWebRemoteOperation(