mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +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 timber.log.Timber
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
|
|
||||||
class GetRemoteAppRegistryOperation : RemoteOperation<AppRegistryResponse>() {
|
class GetRemoteAppRegistryOperation(private val appUrl: String?) : RemoteOperation<AppRegistryResponse>() {
|
||||||
|
|
||||||
override fun run(client: OwnCloudClient): RemoteOperationResult<AppRegistryResponse> {
|
override fun run(client: OwnCloudClient): RemoteOperationResult<AppRegistryResponse> {
|
||||||
var result: RemoteOperationResult<AppRegistryResponse>
|
var result: RemoteOperationResult<AppRegistryResponse>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val uriBuilder = client.baseUri.buildUpon().apply {
|
val uriBuilder = client.baseUri.buildUpon().apply {
|
||||||
appendEncodedPath(APP_REGISTRY_ENDPOINT)
|
appendEncodedPath(appUrl)
|
||||||
}
|
}
|
||||||
val getMethod = GetMethod(URL(uriBuilder.build().toString()))
|
val getMethod = GetMethod(URL(uriBuilder.build().toString()))
|
||||||
val status = client.executeHttpMethod(getMethod)
|
val status = client.executeHttpMethod(getMethod)
|
||||||
@ -75,8 +75,4 @@ class GetRemoteAppRegistryOperation : RemoteOperation<AppRegistryResponse>() {
|
|||||||
|
|
||||||
return result
|
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
|
import com.owncloud.android.lib.resources.appregistry.responses.AppRegistryResponse
|
||||||
|
|
||||||
interface AppRegistryService : Service {
|
interface AppRegistryService : Service {
|
||||||
fun getAppRegistry(): RemoteOperationResult<AppRegistryResponse>
|
fun getAppRegistry(appUrl: String?): RemoteOperationResult<AppRegistryResponse>
|
||||||
|
|
||||||
fun getUrlToOpenInWeb(
|
fun getUrlToOpenInWeb(
|
||||||
openWebEndpoint: String,
|
openWebEndpoint: String,
|
||||||
|
@ -31,8 +31,8 @@ import com.owncloud.android.lib.resources.appregistry.GetUrlToOpenInWebRemoteOpe
|
|||||||
import com.owncloud.android.lib.resources.appregistry.responses.AppRegistryResponse
|
import com.owncloud.android.lib.resources.appregistry.responses.AppRegistryResponse
|
||||||
|
|
||||||
class OCAppRegistryService(override val client: OwnCloudClient) : AppRegistryService {
|
class OCAppRegistryService(override val client: OwnCloudClient) : AppRegistryService {
|
||||||
override fun getAppRegistry(): RemoteOperationResult<AppRegistryResponse> =
|
override fun getAppRegistry(appUrl: String?): RemoteOperationResult<AppRegistryResponse> =
|
||||||
GetRemoteAppRegistryOperation().execute(client)
|
GetRemoteAppRegistryOperation(appUrl).execute(client)
|
||||||
|
|
||||||
override fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String, appName: String): RemoteOperationResult<String> =
|
override fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String, appName: String): RemoteOperationResult<String> =
|
||||||
GetUrlToOpenInWebRemoteOperation(
|
GetUrlToOpenInWebRemoteOperation(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user