Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.*;

import java.util.*;

public class Main {
    public static Map<String, String> getCCMapFromFile() {
        Map result = new HashMap();
        try {
            InputStreamReader insReader = new InputStreamReader(new FileInputStream(new File("tb_category")),
                    "utf-8");
            BufferedReader bufReader = new BufferedReader(insReader);
            String temp;
            while ((temp = bufReader.readLine()) != null) {
                String[] tempA = temp.split("#######");
                result.put(tempA[0], tempA[1]);
            }
            bufReader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }
}