|
22 | 22 |
|
23 | 23 | package com.owncloud.android.data.files.datasources.implementation |
24 | 24 |
|
| 25 | +import androidx.annotation.VisibleForTesting |
25 | 26 | import com.owncloud.android.data.ClientManager |
26 | 27 | import com.owncloud.android.data.executeRemoteOperation |
27 | 28 | import com.owncloud.android.data.files.datasources.RemoteFileDataSource |
@@ -202,23 +203,26 @@ class OCRemoteFileDataSource( |
202 | 203 | ) |
203 | 204 | } |
204 | 205 |
|
205 | | - private fun RemoteFile.toModel(): OCFile = |
206 | | - OCFile( |
207 | | - owner = owner, |
208 | | - remoteId = remoteId, |
209 | | - remotePath = remotePath, |
210 | | - length = if (isFolder) { |
211 | | - size |
212 | | - } else { |
213 | | - length |
214 | | - }, |
215 | | - creationTimestamp = creationTimestamp, |
216 | | - modificationTimestamp = modifiedTimestamp, |
217 | | - mimeType = mimeType, |
218 | | - etag = etag, |
219 | | - permissions = permissions, |
220 | | - privateLink = privateLink, |
221 | | - sharedWithSharee = sharedWithSharee, |
222 | | - sharedByLink = sharedByLink, |
223 | | - ) |
| 206 | + companion object { |
| 207 | + @VisibleForTesting |
| 208 | + fun RemoteFile.toModel(): OCFile = |
| 209 | + OCFile( |
| 210 | + owner = owner, |
| 211 | + remoteId = remoteId, |
| 212 | + remotePath = remotePath, |
| 213 | + length = if (isFolder) { |
| 214 | + size |
| 215 | + } else { |
| 216 | + length |
| 217 | + }, |
| 218 | + creationTimestamp = creationTimestamp, |
| 219 | + modificationTimestamp = modifiedTimestamp, |
| 220 | + mimeType = mimeType, |
| 221 | + etag = etag, |
| 222 | + permissions = permissions, |
| 223 | + privateLink = privateLink, |
| 224 | + sharedWithSharee = sharedWithSharee, |
| 225 | + sharedByLink = sharedByLink, |
| 226 | + ) |
| 227 | + } |
224 | 228 | } |
0 commit comments