import android.net.Uri;
import android.os.Environment;
+import android.os.StatFs;
+
import com.owncloud.android.datamodel.OCFile;
// URL encoding is an 'easy fix' to overcome that NTFS and FAT32 don't allow ":" in file names, that can be in the accountName since 0.1.190B
}
+ public static final long getUsableSpace(String accountName) {
+ File savePath = Environment.getExternalStorageDirectory();
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
+ return savePath.getUsableSpace();
+
+ } else {
+ StatFs stats = new StatFs(savePath.getAbsolutePath());
+ return stats.getAvailableBlocks() * stats.getBlockSize();
+ }
+
+ }
}
\ No newline at end of file