Java Properties Load from File loadPriority()

Here you can find the source of loadPriority()

Description

load Priority

License

Open Source License

Declaration

public static void loadPriority() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedReader;

import java.io.FileReader;

import java.util.ArrayList;

public class Main {
    private static final String PAGEOBJECT_PATH = "./src/main/resources/com/properties/";
    private static ArrayList<String> priorityList;

    public static void loadPriority() {
        if (priorityList == null)
            priorityList = new ArrayList<String>();
        try {//from   ww  w  .j av a 2  s . c  o  m
            FileReader fr = new FileReader(PAGEOBJECT_PATH + "priority.list");
            BufferedReader br = new BufferedReader(fr);
            String line = "";
            while ((line = br.readLine()) != null) {
                line = line.trim();
                if (line.startsWith("#") || line.length() == 0)
                    continue;
                priorityList.add(line.toUpperCase());

            }
            br.close();
            fr.close();
        } catch (Exception e) {
            System.out.println("Error in priority file");
        }
    }
}

Related

  1. loadNative(File nativeLibsFolder)
  2. loadNecessaryPackagePrivateProperties(Class aClass, String aFileName)
  3. loadOSDependentLibrary()
  4. loadParamFromFile(String fileName, String param, String defValue)
  5. loadParams(String fileName)
  6. loadProperties(File directory, String propertiesFileName)
  7. loadProperties(File f)
  8. loadProperties(File file)
  9. loadProperties(File file)