Use UIL StorageUtils to get File Path
This commit is contained in:
parent
900a8d150e
commit
5da0d82487
1 changed files with 3 additions and 8 deletions
|
@ -24,6 +24,8 @@ package de.luhmer.owncloudnewsreader.helper;
|
|||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
|
||||
import com.nostra13.universalimageloader.utils.StorageUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -68,14 +70,7 @@ public class FileUtils {
|
|||
}
|
||||
|
||||
public static String getPath(Context context) {
|
||||
File externalCacheDir = context.getExternalCacheDir();
|
||||
final String cachePath =
|
||||
(Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) ||
|
||||
!Environment.isExternalStorageRemovable()) && externalCacheDir != null ?
|
||||
externalCacheDir.getPath() :
|
||||
context.getCacheDir().getPath();
|
||||
|
||||
return cachePath;
|
||||
return StorageUtils.getCacheDirectory(context).getPath();
|
||||
}
|
||||
|
||||
public static boolean DeletePodcastFile(Context context, String url) {
|
||||
|
|
Loading…
Reference in a new issue