@@ -262,7 +262,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
262262 private fun getShortcutImage (path : String , drawable : Drawable , callback : () -> Unit ) {
263263 val appIconColor = baseConfig.appIconColor
264264 (drawable as LayerDrawable ).findDrawableByLayerId(R .id.shortcut_folder_background).applyColorFilter(appIconColor)
265- if (File (path).isDirectory ) {
265+ if (activity.getIsPathDirectory (path)) {
266266 callback()
267267 } else {
268268 Thread {
@@ -297,7 +297,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
297297 }
298298
299299 private fun addFileUris (path : String , paths : ArrayList <String >) {
300- if (File (path).isDirectory ) {
300+ if (activity.getIsPathDirectory (path)) {
301301 val shouldShowHidden = activity.config.shouldShowHidden
302302 if (activity.isPathOnOTG(path)) {
303303 activity.getDocumentFile(path)?.listFiles()?.filter { if (shouldShowHidden) true else ! it.name!! .startsWith(" ." ) }?.forEach {
@@ -471,10 +471,10 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
471471 val newPath = " $parentPath /$newFolderName /${entry.name.trimEnd(' /' )} "
472472
473473 val resolution = getConflictResolution(conflictResolutions, newPath)
474- val doesPathExist = File (newPath).exists( )
474+ val doesPathExist = activity.getDoesFilePathExist(newPath )
475475 if (doesPathExist && resolution == CONFLICT_OVERWRITE ) {
476476 val fileDirItem = FileDirItem (newPath, newPath.getFilenameFromPath(), entry.isDirectory)
477- if (File (it).isDirectory ) {
477+ if (activity.getIsPathDirectory (it)) {
478478 activity.deleteFolderBg(fileDirItem, false ) {
479479 if (it) {
480480 extractEntry(newPath, entry, zipFile)
@@ -505,7 +505,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
505505
506506 private fun extractEntry (newPath : String , entry : ZipEntry , zipFile : ZipFile ) {
507507 if (entry.isDirectory) {
508- if (! activity.createDirectorySync(newPath) && ! File (newPath).exists( )) {
508+ if (! activity.createDirectorySync(newPath) && ! activity.getDoesFilePathExist(newPath )) {
509509 val error = String .format(activity.getString(R .string.could_not_create_file), newPath)
510510 activity.showErrorToast(error)
511511 }
@@ -544,17 +544,17 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
544544 val base = mainFile.parentFile.toURI()
545545 res = zout
546546 queue.push(mainFile)
547- if (mainFile.isDirectory ) {
547+ if (activity.getIsPathDirectory( mainFile.absolutePath) ) {
548548 name = " ${mainFile.name.trimEnd(' /' )} /"
549549 zout.putNextEntry(ZipEntry (name))
550550 }
551551
552552 while (! queue.isEmpty()) {
553553 mainFile = queue.pop()
554- if (mainFile.isDirectory ) {
554+ if (activity.getIsPathDirectory( mainFile.absolutePath) ) {
555555 for (file in mainFile.listFiles()) {
556556 name = base.relativize(file.toURI()).path
557- if (file.isDirectory ) {
557+ if (activity.getIsPathDirectory( file.absolutePath) ) {
558558 queue.push(file)
559559 name = " ${name.trimEnd(' /' )} /"
560560 zout.putNextEntry(ZipEntry (name))
0 commit comments