Skip to content

Commit ed848eb

Browse files
authored
Added uri2FileNoCacheCopy
1 parent ac872f8 commit ed848eb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/utilcode/src/main/java/com/blankj/utilcode/util/UriUtils.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ public static File uri2File(final Uri uri) {
7777
return copyUri2Cache(uri);
7878
}
7979

80+
/**
81+
* Uri to file, without creating the cache copy if the path cannot be resolved.
82+
*
83+
* @param uri The uri.
84+
* @return file
85+
*/
86+
public static File uri2FileNoCacheCopy(final Uri uri) {
87+
if (uri == null) return null;
88+
return uri2FileReal(uri);
89+
}
90+
8091
/**
8192
* Uri to file.
8293
*

0 commit comments

Comments
 (0)