Java tutorial
//package com.java2s; //License from project: LGPL import java.io.File; import android.content.Context; import android.util.Log; public class Main { private static final String TAG = "CompatFileUtils"; private static Object sSync = new Object(); private static File sCacheDir; private static File getCacheDirImpl(Context c) { synchronized (sSync) { sCacheDir = new File(c.getFilesDir(), "cache"); if (sCacheDir.exists() == false) { if (sCacheDir.mkdirs() == false) { Log.w(TAG, "Unable to create cache directory"); return null; } } } return sCacheDir; } }