mirror of
https://github.com/owncloud/android-library.git
synced 2025-07-10 07:58:54 +00:00
Compare commits
No commits in common. "22bb4eaf219683dfa0bd51ccd91a3f7246103b7a" and "defa4d1469b780919e17797d9191a089b5ac9d7a" have entirely different histories.
22bb4eaf21
...
defa4d1469
@ -45,7 +45,7 @@ import java.net.URL
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Capabilities from the server
|
* Get the Capabilities from the server
|
||||||
* Save Result.getData in a RemoteCapability object
|
* Save in Result.getData in a RemoteCapability object
|
||||||
*
|
*
|
||||||
* @author masensio
|
* @author masensio
|
||||||
* @author David González Verdugo
|
* @author David González Verdugo
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
/**
|
/* ownCloud Android Library is available under MIT license
|
||||||
* ownCloud Android Library is available under MIT license
|
|
||||||
*
|
|
||||||
* @author masensio
|
* @author masensio
|
||||||
* @author David González Verdugo
|
* @author David González Verdugo
|
||||||
* @author Abel García de Prada
|
* @author Abel García de Prada
|
||||||
* @author Juan Carlos Garrote Gascón
|
* Copyright (C) 2020 ownCloud GmbH.
|
||||||
*
|
|
||||||
* Copyright (C) 2022 ownCloud GmbH.
|
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -26,8 +22,8 @@
|
|||||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.owncloud.android.lib.resources.status
|
package com.owncloud.android.lib.resources.status
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,7 +33,7 @@ data class RemoteCapability(
|
|||||||
var accountName: String = "",
|
var accountName: String = "",
|
||||||
|
|
||||||
// Server version
|
// Server version
|
||||||
var versionMajor: Int = 0,
|
var versionMayor: Int = 0,
|
||||||
var versionMinor: Int = 0,
|
var versionMinor: Int = 0,
|
||||||
var versionMicro: Int = 0,
|
var versionMicro: Int = 0,
|
||||||
var versionString: String = "",
|
var versionString: String = "",
|
||||||
@ -72,10 +68,7 @@ data class RemoteCapability(
|
|||||||
var filesUndelete: CapabilityBooleanType = CapabilityBooleanType.UNKNOWN,
|
var filesUndelete: CapabilityBooleanType = CapabilityBooleanType.UNKNOWN,
|
||||||
var filesVersioning: CapabilityBooleanType = CapabilityBooleanType.UNKNOWN,
|
var filesVersioning: CapabilityBooleanType = CapabilityBooleanType.UNKNOWN,
|
||||||
val filesPrivateLinks: CapabilityBooleanType = CapabilityBooleanType.UNKNOWN,
|
val filesPrivateLinks: CapabilityBooleanType = CapabilityBooleanType.UNKNOWN,
|
||||||
val filesAppProviders: List<RemoteAppProviders>?,
|
val filesAppProviders: List<RemoteOCISProvider>?,
|
||||||
|
|
||||||
// Spaces
|
|
||||||
val spaces: RemoteSpaces?,
|
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
* Enum for Boolean Type in capabilities, with values:
|
* Enum for Boolean Type in capabilities, with values:
|
||||||
@ -108,7 +101,7 @@ data class RemoteCapability(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data class RemoteAppProviders(
|
data class RemoteOCISProvider(
|
||||||
val enabled: Boolean,
|
val enabled: Boolean,
|
||||||
val version: String,
|
val version: String,
|
||||||
val appsUrl: String?,
|
val appsUrl: String?,
|
||||||
@ -116,10 +109,4 @@ data class RemoteCapability(
|
|||||||
val openWebUrl: String?,
|
val openWebUrl: String?,
|
||||||
val newUrl: String?,
|
val newUrl: String?,
|
||||||
)
|
)
|
||||||
|
|
||||||
data class RemoteSpaces(
|
|
||||||
val enabled: Boolean,
|
|
||||||
val projects: Boolean,
|
|
||||||
val shareJail: Boolean,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
/**
|
/* ownCloud Android Library is available under MIT license
|
||||||
* ownCloud Android Library is available under MIT license
|
|
||||||
*
|
|
||||||
* @author Abel García de Prada
|
* @author Abel García de Prada
|
||||||
* @author Juan Carlos Garrote Gascón
|
* Copyright (C) 2020 ownCloud GmbH.
|
||||||
*
|
|
||||||
* Copyright (C) 2022 ownCloud GmbH.
|
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -24,12 +20,13 @@
|
|||||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.owncloud.android.lib.resources.status.responses
|
package com.owncloud.android.lib.resources.status.responses
|
||||||
|
|
||||||
import com.owncloud.android.lib.resources.status.RemoteCapability
|
import com.owncloud.android.lib.resources.status.RemoteCapability
|
||||||
import com.owncloud.android.lib.resources.status.RemoteCapability.*
|
import com.owncloud.android.lib.resources.status.RemoteCapability.CapabilityBooleanType
|
||||||
|
import com.owncloud.android.lib.resources.status.RemoteCapability.RemoteOCISProvider
|
||||||
import com.squareup.moshi.Json
|
import com.squareup.moshi.Json
|
||||||
import com.squareup.moshi.JsonClass
|
import com.squareup.moshi.JsonClass
|
||||||
|
|
||||||
@ -40,7 +37,7 @@ data class CapabilityResponse(
|
|||||||
val capabilities: Capabilities?
|
val capabilities: Capabilities?
|
||||||
) {
|
) {
|
||||||
fun toRemoteCapability(): RemoteCapability = RemoteCapability(
|
fun toRemoteCapability(): RemoteCapability = RemoteCapability(
|
||||||
versionMajor = serverVersion?.major ?: 0,
|
versionMayor = serverVersion?.major ?: 0,
|
||||||
versionMinor = serverVersion?.minor ?: 0,
|
versionMinor = serverVersion?.minor ?: 0,
|
||||||
versionMicro = serverVersion?.micro ?: 0,
|
versionMicro = serverVersion?.micro ?: 0,
|
||||||
versionString = serverVersion?.string ?: "",
|
versionString = serverVersion?.string ?: "",
|
||||||
@ -73,11 +70,10 @@ data class CapabilityResponse(
|
|||||||
filesUndelete = CapabilityBooleanType.fromBooleanValue(capabilities?.fileCapabilities?.undelete),
|
filesUndelete = CapabilityBooleanType.fromBooleanValue(capabilities?.fileCapabilities?.undelete),
|
||||||
filesVersioning = CapabilityBooleanType.fromBooleanValue(capabilities?.fileCapabilities?.versioning),
|
filesVersioning = CapabilityBooleanType.fromBooleanValue(capabilities?.fileCapabilities?.versioning),
|
||||||
filesPrivateLinks = capabilities?.fileCapabilities?.privateLinks?.let { CapabilityBooleanType.fromBooleanValue(it) } ?: CapabilityBooleanType.UNKNOWN,
|
filesPrivateLinks = capabilities?.fileCapabilities?.privateLinks?.let { CapabilityBooleanType.fromBooleanValue(it) } ?: CapabilityBooleanType.UNKNOWN,
|
||||||
filesAppProviders = capabilities?.fileCapabilities?.appProviders?.map { it.toAppProviders() },
|
filesAppProviders = capabilities?.fileCapabilities?.appProviders?.map { it.toOCISProvider() },
|
||||||
filesSharingFederationIncoming = CapabilityBooleanType.fromBooleanValue(capabilities?.fileSharingCapabilities?.fileSharingFederation?.incoming),
|
filesSharingFederationIncoming = CapabilityBooleanType.fromBooleanValue(capabilities?.fileSharingCapabilities?.fileSharingFederation?.incoming),
|
||||||
filesSharingFederationOutgoing = CapabilityBooleanType.fromBooleanValue(capabilities?.fileSharingCapabilities?.fileSharingFederation?.outgoing),
|
filesSharingFederationOutgoing = CapabilityBooleanType.fromBooleanValue(capabilities?.fileSharingCapabilities?.fileSharingFederation?.outgoing),
|
||||||
filesSharingUserProfilePicture = CapabilityBooleanType.fromBooleanValue(capabilities?.fileSharingCapabilities?.fileSharingUser?.profilePicture),
|
filesSharingUserProfilePicture = CapabilityBooleanType.fromBooleanValue(capabilities?.fileSharingCapabilities?.fileSharingUser?.profilePicture),
|
||||||
spaces = capabilities?.spacesCapabilities?.toSpaces(),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,9 +86,7 @@ data class Capabilities(
|
|||||||
@Json(name = "files")
|
@Json(name = "files")
|
||||||
val fileCapabilities: FileCapabilities?,
|
val fileCapabilities: FileCapabilities?,
|
||||||
@Json(name = "dav")
|
@Json(name = "dav")
|
||||||
val davCapabilities: DavCapabilities?,
|
val davCapabilities: DavCapabilities?
|
||||||
@Json(name = "spaces")
|
|
||||||
val spacesCapabilities: SpacesCapabilities?,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
@ -188,7 +182,7 @@ data class AppProvider(
|
|||||||
@Json(name = "new_url")
|
@Json(name = "new_url")
|
||||||
val newUrl: String?,
|
val newUrl: String?,
|
||||||
) {
|
) {
|
||||||
fun toAppProviders() = RemoteAppProviders(enabled, version, appsUrl, openUrl, openWebUrl, newUrl)
|
fun toOCISProvider() = RemoteOCISProvider(enabled, version, appsUrl, openUrl, openWebUrl, newUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
@ -196,16 +190,6 @@ data class DavCapabilities(
|
|||||||
val chunking: String?
|
val chunking: String?
|
||||||
)
|
)
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
|
||||||
data class SpacesCapabilities(
|
|
||||||
val enabled: Boolean,
|
|
||||||
val projects: Boolean,
|
|
||||||
@Json(name = "share_jail")
|
|
||||||
val shareJail: Boolean,
|
|
||||||
) {
|
|
||||||
fun toSpaces() = RemoteSpaces(enabled, projects, shareJail)
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class ServerVersion(
|
data class ServerVersion(
|
||||||
var major: Int?,
|
var major: Int?,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user