This repository was archived by the owner on Mar 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 23
23
*/
24
24
package com.owncloud.android.lib.resources.status.services
25
25
26
+ import com.owncloud.android.lib.common.OwnCloudClient
26
27
import com.owncloud.android.lib.common.operations.RemoteOperationResult
27
28
import com.owncloud.android.lib.resources.status.OwnCloudVersion
28
29
29
30
interface ServerInfoService {
30
- fun checkPathExistence (path : String , isUserLogged : Boolean ): RemoteOperationResult <Boolean >
31
+ fun checkPathExistence (path : String , isUserLogged : Boolean , client : OwnCloudClient ): RemoteOperationResult <Boolean >
31
32
32
- fun getRemoteStatus (path : String ): RemoteOperationResult <OwnCloudVersion >
33
+ fun getRemoteStatus (path : String , client : OwnCloudClient ): RemoteOperationResult <OwnCloudVersion >
33
34
}
Original file line number Diff line number Diff line change 19
19
20
20
package com.owncloud.android.lib.resources.status.services.implementation
21
21
22
- import android.net.Uri
23
22
import com.owncloud.android.lib.common.OwnCloudClient
24
- import com.owncloud.android.lib.common.authentication.OwnCloudCredentialsFactory.getAnonymousCredentials
25
23
import com.owncloud.android.lib.common.operations.RemoteOperationResult
26
- import com.owncloud.android.lib.resources.status.services.ServerInfoService
27
24
import com.owncloud.android.lib.resources.files.CheckPathExistenceRemoteOperation
28
25
import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation
29
26
import com.owncloud.android.lib.resources.status.OwnCloudVersion
27
+ import com.owncloud.android.lib.resources.status.services.ServerInfoService
30
28
31
29
class OCServerInfoService : ServerInfoService {
32
- override fun checkPathExistence (path : String , isUserLogged : Boolean ): RemoteOperationResult <Boolean > =
30
+
31
+ override fun checkPathExistence (
32
+ path : String ,
33
+ isUserLogged : Boolean ,
34
+ client : OwnCloudClient
35
+ ): RemoteOperationResult <Boolean > =
33
36
CheckPathExistenceRemoteOperation (
34
37
remotePath = path,
35
38
isUserLogged = true
36
- ).execute(createClientFromPath(path))
37
-
38
- override fun getRemoteStatus (path : String ): RemoteOperationResult <OwnCloudVersion > =
39
- GetRemoteStatusOperation ().execute(createClientFromPath(path))
39
+ ).execute(client)
40
40
41
- private fun createClientFromPath (path : String ): OwnCloudClient {
42
- return OwnCloudClient (Uri .parse(path)).apply { credentials = getAnonymousCredentials() }
43
- }
41
+ override fun getRemoteStatus (
42
+ path : String ,
43
+ client : OwnCloudClient
44
+ ): RemoteOperationResult <OwnCloudVersion > =
45
+ GetRemoteStatusOperation ().execute(client)
44
46
}
You can’t perform that action at this time.
0 commit comments