Skip to content

Commit 7377303

Browse files
committed
Only delete the current file.
1 parent 4879401 commit 7377303

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

dfc/src/main/java/com/lazygeniouz/dfc/file/internals/RawDocumentFileCompat.kt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ import java.io.File
1414
internal class RawDocumentFileCompat constructor(context: Context, var file: File) :
1515
DocumentFileCompat(context, file) {
1616

17-
/**
18-
* Returns a [Uri] via [Uri.fromFile] but
19-
* if you want to use the **FileProvider** api to get a Uri,
20-
* you should convert this Uri to a File, make your checks if necessary &
21-
* then use **FileProvider.getUriForFile**.
22-
*/
23-
override val uri: Uri
24-
get() = Uri.fromFile(file)
25-
2617
// Get file extension.
2718
override val extension: String
2819
get() = file.extension
@@ -33,12 +24,9 @@ internal class RawDocumentFileCompat constructor(context: Context, var file: Fil
3324

3425
/**
3526
* Delete the file & return the result.
36-
*
37-
* Note it will delete the everything **recursively** if this is a folder
38-
* because this uses Kotlin extension [File.deleteRecursively].
3927
*/
4028
override fun delete(): Boolean {
41-
return file.deleteRecursively()
29+
return file.delete()
4230
}
4331

4432
// Check if the file exists.

0 commit comments

Comments
 (0)