aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java b/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java
index ce289968..77c313f7 100644
--- a/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java
+++ b/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java
@@ -13,6 +13,7 @@ import android.provider.MediaStore;
import android.provider.OpenableColumns;
import java.io.File;
+import java.net.URL;
import java.util.List;
import de.thedevstack.conversationsplus.ConversationsPlusApplication;
@@ -161,6 +162,14 @@ public final class FileUtils {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
+ public static String getRelevantExtension(URL url) {
+ if (url == null) {
+ return null;
+ }
+ String path = url.getPath();
+ return getRelevantExtension(path);
+ }
+
public static String getRelevantExtension(String path) {
if (path == null || path.isEmpty()) {
return null;