Code example for File

Methods: existsmkdir

	 * @param context Application context 
	 * @return Cache {@link File directory} 
	public static File getIndividualCacheDirectory(Context context) {
		File cacheDir = getCacheDirectory(context);
		File individualCacheDir = new File(cacheDir, INDIVIDUAL_DIR_NAME);
		if (!individualCacheDir.exists()) {
			if (!individualCacheDir.mkdir()) {
				individualCacheDir = cacheDir;
		return individualCacheDir;
	 * Returns specified application cache directory. Cache directory will be created on SD card by defined path if card 
	 * is mounted and app has appropriate permission. Else - Android defines cache directory on device's file system. 
	 * @param context  Application context 
	 * @param cacheDir Cache directory path (e.g.: "AppCacheDir", "AppDir/cache/images") 
Connect your IDE to all the code out there  Get Codota for Java