Java tutorial
//package com.java2s; import java.io.File; import java.io.IOException; public class Main { private static String T_FLASH_PATH = "/storage/sdcard1"; public static boolean testNewTfFile() { File testFile = new File(T_FLASH_PATH, "testNewFile"); boolean returnFlag = false; if (!testFile.exists()) { try { if (testFile.createNewFile()) { returnFlag = true; testFile.delete(); } } catch (IOException e) { returnFlag = false; } } else { testFile.delete(); returnFlag = true; } return returnFlag; } }