Skip to content

Commit

Permalink
base url shall never be null
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <[email protected]>
  • Loading branch information
tobiasKaminsky committed Jun 25, 2024
1 parent 0c3c568 commit 76a860b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@ import com.owncloud.android.lib.common.network.WebdavUtils
* When finally getting rid of [com.owncloud.android.lib.common.OwnCloudClient],
* this should be separate from the client.
*/
class NextcloudUriDelegate(baseUri: Uri, var userId: String?) : NextcloudUriProvider {
class NextcloudUriDelegate(override var baseUri: Uri, var userId: String?) : NextcloudUriProvider {
constructor(baseUri: Uri) : this(baseUri, null)

val userIdEncoded: String?
get() = userId?.let { UserIdEncoder.encode(it) }

/**
* Root URI of the Nextcloud server
*/
override var baseUri: Uri? = baseUri
set(uri) {
requireNotNull(uri) { "URI cannot be NULL" }
field = uri
}

override val filesDavUri: Uri
get() = Uri.parse("$davUri/files/$userIdEncoded")
override val uploadUri: Uri
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface NextcloudUriProvider {
/**
* Root URI of the Nextcloud server
*/
var baseUri: Uri?
var baseUri: Uri
val filesDavUri: Uri
val uploadUri: Uri
val davUri: Uri
Expand Down

0 comments on commit 76a860b

Please sign in to comment.