File (String relativePath) { relativePath = trimStartSlash(relativePath); String prefix = myPrefix; if (prefix != null) { prefix = trimStartSlash(ensureEndsWithSlash(prefix)); if (!relativePath.toLowerCase(Locale.ENGLISH).startsWith(prefix.toLowerCase(Locale.ENGLISH))) { return null; } relativePath = relativePath.substring(prefix.length()); } String[] dirsList = list(); for (String aDirsList : dirsList) { String fullPath = ensureEndsWithSlash(aDirsList) + relativePath; File file = new File(fullPath.replace('/', File.separatorChar)); if (file.isFile()) { return file; } } return null; }