package com.littlepanpc.downloader.util;

import android.os.Environment;
import android.os.StatFs;

public class StorageUtils {
	public static final String DOWNLOAD_DIRECTORY = Environment
			.getExternalStorageDirectory() + "/downloads";
	public static final String DOWNLOAD_DIRECTORY_TEMP = Environment
			.getExternalStorageDirectory() + "/downloads/tmps";

	public static long getAvailableStorage() {

		String storageDirectory = Environment.getExternalStorageDirectory()
				.toString();

		try {
			StatFs stat = new StatFs(storageDirectory);
			long avaliableSize = ((long) stat.getAvailableBlocks() * (long) stat
					.getBlockSize());
			return avaliableSize;
		} catch (RuntimeException ex) {
			return 0;
		}
	}

}

@@ -353,16 +353,130 @@
 /tmps%22;%0A
+%09/**%0A%09 * @Title: getAvailableStorage%0A%09 * @Description: obtain available storage%0A%09 * @return long%0A%09 * @throws %0A%09 */
 %0A%09public

Update StorageUtils.java