Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base url shall never be null #1485

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading