Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Main {
    public static String xpathconf_path = "/home/sduprey/My_Data/My_Xpath_Conf/xpath.conf";
    private static int xpath_size = 10;
    private static String[] xpath_expression;

    public static void loadXPATHConf() {
        xpath_expression = new String[xpath_size];
        BufferedReader br;
        try {
            br = new BufferedReader(new FileReader(xpathconf_path));

            String line = "";
            int counter = 0;
            while (((line = br.readLine()) != null) && counter < xpath_size) {
                xpath_expression[counter] = line;
                counter++;
            }
            br.close();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}