Java tutorial
//package com.java2s; import java.io.File; public class Main { public static String getDictName(String dictFolderPath) { String dictName = null; File f = new File(dictFolderPath); if (!f.exists()) return null; File[] files = f.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isFile()) { if (files[i].getName().endsWith(".ifo")) { dictName = files[i].getName().replace(".ifo", ""); break; } } } return dictName; } }