181cc925173a495e2d4aa85302f92b96cdb9001e
1 package com
.owncloud
.android
.ui
.adapter
;
5 import android
.content
.Context
;
6 import android
.os
.Build
;
7 import android
.os
.Environment
;
10 public static final int IO_BUFFER_SIZE
= 8 * 1024;
14 public static boolean isExternalStorageRemovable() {
15 if (Build
.VERSION
.SDK_INT
>= Build
.VERSION_CODES
.GINGERBREAD
) {
16 return Environment
.isExternalStorageRemovable();
21 public static File
getExternalCacheDir(Context context
) {
22 if (hasExternalCacheDir()) {
23 return context
.getExternalCacheDir();
26 // Before Froyo we need to construct the external cache dir ourselves
27 final String cacheDir
= "/Android/data/" + context
.getPackageName() + "/cache/";
28 return new File(Environment
.getExternalStorageDirectory().getPath() + cacheDir
);
31 public static boolean hasExternalCacheDir() {
32 return Build
.VERSION
.SDK_INT
>= Build
.VERSION_CODES
.FROYO
;