diff options
author | steckbrief <steckbrief@chefmail.de> | 2016-03-12 21:22:44 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2016-03-12 21:22:44 +0100 |
commit | 340272ba841be12dcdf1317e183a45d8b46dce44 (patch) | |
tree | 4c4cf2121ccfdb1da3ab2825f6ee2de9132531be /src/main/java/eu/siacs/conversations/utils | |
parent | 86afdc7aaff4ed6fa37e6d5fd9e5ffab20375f21 (diff) | |
parent | a95d2d9134508ec694cb48db361f1fd4387d1827 (diff) |
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/FileUtils.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/FileUtils.java b/src/main/java/eu/siacs/conversations/utils/FileUtils.java index 967c9b41..b12c990b 100644 --- a/src/main/java/eu/siacs/conversations/utils/FileUtils.java +++ b/src/main/java/eu/siacs/conversations/utils/FileUtils.java @@ -11,25 +11,26 @@ import android.os.Environment; import android.provider.DocumentsContract; import android.provider.MediaStore; -public class FileUtils { +import de.thedevstack.conversationsplus.ConversationsPlusApplication; + +public final class FileUtils { /** * Get a file path from a Uri. This will get the the path for Storage Access * Framework Documents, as well as the _data field for the MediaStore and * other file-based ContentProviders. * - * @param context The context. * @param uri The Uri to query. * @author paulburke */ @SuppressLint("NewApi") - public static String getPath(final Context context, final Uri uri) { + public static String getPath(final Uri uri) { if (uri == null) { return null; } final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; - + final Context context = ConversationsPlusApplication.getAppContext(); // DocumentProvider if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { // ExternalStorageProvider @@ -98,7 +99,7 @@ public class FileUtils { * @param selectionArgs (Optional) Selection arguments used in the query. * @return The value of the _data column, which is typically a file path. */ - public static String getDataColumn(Context context, Uri uri, String selection, + private static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) { Cursor cursor = null; @@ -176,4 +177,8 @@ public class FileUtils { filename.substring(secondToLastDotPosition + 1, lastDotPosition) : ""; return secondToLastPart; } + + private FileUtils() { + // Utility class - do not instantiate + } } |