@@ -0,0 +1,726 @@
+package com.littlepanpc.downloader.util;%0A%0Aimport android.os.Environment;%0Aimport android.os.StatFs;%0A%0Apublic class StorageUtils %7B%0A%09public static final String DOWNLOAD_DIRECTORY = Environment%0A%09%09%09.getExternalStorageDirectory() + %22/downloads%22;%0A%09public static final String DOWNLOAD_DIRECTORY_TEMP = Environment%0A%09%09%09.getExternalStorageDirectory() + %22/downloads/tmps%22;%0A%0A%09public static long getAvailableStorage() %7B%0A%0A%09%09String storageDirectory = Environment.getExternalStorageDirectory()%0A%09%09%09%09.toString();%0A%0A%09%09try %7B%0A%09%09%09StatFs stat = new StatFs(storageDirectory);%0A%09%09%09long avaliableSize = ((long) stat.getAvailableBlocks() * (long) stat%0A%09%09%09%09%09.getBlockSize());%0A%09%09%09return avaliableSize;%0A%09%09%7D catch (RuntimeException ex) %7B%0A%09%09%09return 0;%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Create StorageUtils.java