Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 7536ba8

Browse files
committed
Apply code review suggestions
1 parent d6ea580 commit 7536ba8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/users/GetRemoteUserAvatarOperation.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,29 @@ import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod
3030
import com.owncloud.android.lib.common.network.WebdavUtils
3131
import com.owncloud.android.lib.common.operations.RemoteOperation
3232
import com.owncloud.android.lib.common.operations.RemoteOperationResult
33+
import com.owncloud.android.lib.resources.files.FileUtils.PATH_SEPARATOR
3334
import timber.log.Timber
3435
import java.io.IOException
3536
import java.io.InputStream
3637
import java.net.URL
3738

38-
class GetRemoteUserAvatarOperation(private val avatarDimension: Int) :
39-
RemoteOperation<RemoteAvatarData>() {
39+
/**
40+
* Gets avatar about the user logged in, if available
41+
*
42+
* @author David A. Velasco
43+
* @author David González Verdugo
44+
*/
45+
class GetRemoteUserAvatarOperation(private val avatarDimension: Int) : RemoteOperation<RemoteAvatarData>() {
4046
override fun run(client: OwnCloudClient): RemoteOperationResult<RemoteAvatarData> {
4147
var inputStream: InputStream? = null
42-
lateinit var getMethod: GetMethod
48+
var result: RemoteOperationResult<RemoteAvatarData>
4349

44-
lateinit var result: RemoteOperationResult<RemoteAvatarData>
4550
try {
4651
val endPoint =
47-
client.baseUri.toString() + NON_OFFICIAL_AVATAR_PATH + client.credentials.username + "/" + avatarDimension
52+
client.baseUri.toString() + NON_OFFICIAL_AVATAR_PATH + client.credentials.username + PATH_SEPARATOR + avatarDimension
4853
Timber.d("avatar URI: %s", endPoint)
4954

50-
getMethod = GetMethod(URL(endPoint))
55+
val getMethod = GetMethod(URL(endPoint))
5156

5257
val status = client.executeHttpMethod(getMethod)
5358

0 commit comments

Comments
 (0)