@@ -30,24 +30,29 @@ import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod
30
30
import com.owncloud.android.lib.common.network.WebdavUtils
31
31
import com.owncloud.android.lib.common.operations.RemoteOperation
32
32
import com.owncloud.android.lib.common.operations.RemoteOperationResult
33
+ import com.owncloud.android.lib.resources.files.FileUtils.PATH_SEPARATOR
33
34
import timber.log.Timber
34
35
import java.io.IOException
35
36
import java.io.InputStream
36
37
import java.net.URL
37
38
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>() {
40
46
override fun run (client : OwnCloudClient ): RemoteOperationResult <RemoteAvatarData > {
41
47
var inputStream: InputStream ? = null
42
- lateinit var getMethod : GetMethod
48
+ var result : RemoteOperationResult < RemoteAvatarData >
43
49
44
- lateinit var result: RemoteOperationResult <RemoteAvatarData >
45
50
try {
46
51
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
48
53
Timber .d(" avatar URI: %s" , endPoint)
49
54
50
- getMethod = GetMethod (URL (endPoint))
55
+ val getMethod = GetMethod (URL (endPoint))
51
56
52
57
val status = client.executeHttpMethod(getMethod)
53
58
0 commit comments