Java tutorial
//package com.java2s; import java.io.File; public class Main { public static boolean isNoMediaDir(File dir) { boolean result = false; if (dir == null || dir.isFile()) { result = true; } else { File[] files = dir.listFiles(); if (files != null) { for (File childFile : files) { if (childFile.isFile() && ".nomedia".equals(childFile.getName())) { result = true; break; } } } } return result; } }