// Path: src/info/xuluan/podcast/utils/SDCardMgr.java
// public class SDCardMgr {
// 
// 	public static String SDCARD_DIR =
// 			Environment.getExternalStorageDirectory().getPath(); //e.g. /sdcard
// 	public static final String APP_DIR = "/xuluan.podcast";
// 	public static final String DOWNLOAD_DIR = "/download";
// 	public static final String EXPORT_DIR = "/export";
// 	
// 	public static boolean getSDCardStatus()
// 	{
// 		return android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
// 	}
// 	
// 	public static boolean getSDCardStatusAndCreate()
// 	{
// 		boolean b = getSDCardStatus();
// 		if(b)
// 			createDir();
// 		return b;
// 	}	
// 
// 	public static String getExportDir()
// 	{
// 		File sdDir = new File(Environment.getExternalStorageDirectory().getPath());
// 		SDCARD_DIR = sdDir.getAbsolutePath();
// 		return SDCARD_DIR + APP_DIR + EXPORT_DIR;
// 	}	
// 
// 	public static String getDownloadDir()
// 	{
// 		File sdDir = new File(Environment.getExternalStorageDirectory().getPath());
// 		SDCARD_DIR = sdDir.getAbsolutePath();
// 		return SDCARD_DIR + APP_DIR + DOWNLOAD_DIR;
// 	}
// 	
// 	public static String getAppDir()
// 	{
// 		File sdDir = new File(Environment.getExternalStorageDirectory().getPath());
// 		SDCARD_DIR = sdDir.getAbsolutePath();
// 		return SDCARD_DIR + APP_DIR;
// 	}
// 
// 
// 	private static boolean createDir()
// 	{
// 		File file = new File(getDownloadDir());
// 		boolean exists = (file.exists());
// 		if (!exists) {
// 			return file.mkdirs();
// 		}
// 		
// 		file = new File(getExportDir());
// 		exists = (file.exists());
// 		if (!exists) {
// 			return file.mkdirs();
// 		}		
// 		return true;
// 	}		
// 
// }


import junit.framework.TestCase;
import info.xuluan.podcast.utils.SDCardMgr;
/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package info.xuluan.podcast.tests;



public class SDCardTest extends TestCase {

    public void testAppDir() throws Exception {
// Path: src/info/xuluan/podcast/utils/SDCardMgr.java
// public class SDCardMgr {
// 
// 	public static String SDCARD_DIR =
// 			Environment.getExternalStorageDirectory().getPath(); //e.g. /sdcard
// 	public static final String APP_DIR = "/xuluan.podcast";
// 	public static final String DOWNLOAD_DIR = "/download";
// 	public static final String EXPORT_DIR = "/export";
// 	
// 	public static boolean getSDCardStatus()
// 	{
// 		return android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
// 	}
// 	
// 	public static boolean getSDCardStatusAndCreate()
// 	{
// 		boolean b = getSDCardStatus();
// 		if(b)
// 			createDir();
// 		return b;
// 	}	
// 
// 	public static String getExportDir()
// 	{
// 		File sdDir = new File(Environment.getExternalStorageDirectory().getPath());
// 		SDCARD_DIR = sdDir.getAbsolutePath();
// 		return SDCARD_DIR + APP_DIR + EXPORT_DIR;
// 	}	
// 
// 	public static String getDownloadDir()
// 	{
// 		File sdDir = new File(Environment.getExternalStorageDirectory().getPath());
// 		SDCARD_DIR = sdDir.getAbsolutePath();
// 		return SDCARD_DIR + APP_DIR + DOWNLOAD_DIR;
// 	}
// 	
// 	public static String getAppDir()
// 	{
// 		File sdDir = new File(Environment.getExternalStorageDirectory().getPath());
// 		SDCARD_DIR = sdDir.getAbsolutePath();
// 		return SDCARD_DIR + APP_DIR;
// 	}
// 
// 
// 	private static boolean createDir()
// 	{
// 		File file = new File(getDownloadDir());
// 		boolean exists = (file.exists());
// 		if (!exists) {
// 			return file.mkdirs();
// 		}
// 		
// 		file = new File(getExportDir());
// 		exists = (file.exists());
// 		if (!exists) {
// 			return file.mkdirs();
// 		}		
// 		return true;
// 	}		
// 
// }


// Path: src/info/xuluan/podcast/tests/SDCardTest.java
import junit.framework.TestCase;
import info.xuluan.podcast.utils.SDCardMgr;

/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package info.xuluan.podcast.tests;



public class SDCardTest extends TestCase {

    public void testAppDir() throws Exception {
        assertTrue(SDCardMgr.getAppDir().equals("/mnt/sdcard/xuluan.podcast"));