Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}