Nicola
09/04/2023, 8:55 AMenum class FileOperationType {
DOWNLOAD,
DOWNLOAD_AND_MOVE,
DOWNLOAD_AND_REMOVE
}
and a function which expects a parameter of that type.
fun downloadAllToLocalFolder(
fileOperation: FileOperation,
...
In a test I invoke that function:
target.downloadAllToLocalFolder(
FileOperation(DOWNLOAD ...
In this line kotlin issues this warning:
Unexpected fileOperation: DOWNLOAD
what does it mean?Nicola
09/04/2023, 8:57 AMSam
09/04/2023, 9:02 AMFileOperationType
, doesn't seem to be the same as the type of the function parameter, FileOperation
. Is that mismatch the cause of the problem?Nicola
09/04/2023, 9:03 AMNicola
09/04/2023, 9:04 AMdata class FileOperation(
val type: FileOperationType,
val hostSourceFolder: FolderName,
val localDestinationFolder: FolderName,
val hostDestinationFolder: FolderName? = null
)
The line which calls the function builds a FileOperation instance, the first parameter is the "type":
target.downloadAllToLocalFolder(
FileOperation(DOWNLOAD, "/$remotePath", outputFolderPath),
...
CLOVIS
09/04/2023, 9:49 AMNicola
09/04/2023, 10:25 AMNicola
09/04/2023, 10:26 AM