File directory; if (filename.isEmpty()) { directory = getFilesDir(); } else { directory = getDir(filename, MODE_PRIVATE); } File[] files = directory.listFiles();