Skip to content

Commit 119912b

Browse files
committed
[feature/remove_unnecesary_code_msd_msf_files] - remove unnecesary code about msf and msd path files
1 parent c3f0162 commit 119912b

File tree

1 file changed

+3
-5
lines changed
  • android/src/main/kotlin/com/mr/flutter/plugin/filepicker

1 file changed

+3
-5
lines changed

android/src/main/kotlin/com/mr/flutter/plugin/filepicker/FileUtils.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ object FileUtils {
7474
uri,
7575
DocumentsContract.getTreeDocumentId(uri)
7676
)
77-
val dirPath = getFullPathFromTreeUri(uri, activity)
77+
val dirPath = getFullPathFromTreeUri(uri)
7878
if (dirPath != null) {
7979
finishWithSuccess(dirPath)
8080
} else {
@@ -521,7 +521,7 @@ object FileUtils {
521521
}
522522

523523
@JvmStatic
524-
fun getFullPathFromTreeUri(treeUri: Uri?, con: Context): String? {
524+
fun getFullPathFromTreeUri(treeUri: Uri?): String? {
525525
if (treeUri == null) {
526526
return null
527527
}
@@ -533,16 +533,14 @@ object FileUtils {
533533
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).path
534534
if (docId == "downloads") {
535535
return extPath
536-
} else if (docId.matches("^ms[df]:.*".toRegex())) {
537-
val fileName = getFileName(treeUri, con)
538-
return "$extPath/$fileName"
539536
} else if (docId.startsWith("raw:")) {
540537
return docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }
541538
.toTypedArray()[1]
542539
}
543540
return null
544541
}
545542
}
543+
546544
var volumePath = getPathFromTreeUri(treeUri)
547545

548546
if (volumePath.endsWith(File.separator)) {

0 commit comments

Comments
 (0)