File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
android/src/main/kotlin/com/mr/flutter/plugin/filepicker Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff 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)) {
You can’t perform that action at this time.
0 commit comments