Java BufferedReader Read loadBlackList(String blackListPath)

Here you can find the source of loadBlackList(String blackListPath)

Description

load Black List

License

Open Source License

Declaration

public static Set<String> loadBlackList(String blackListPath) throws IOException 

Method Source Code


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

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

import java.util.Set;
import java.util.HashSet;

public class Main {
    public static Set<String> loadBlackList(String blackListPath) throws IOException {

        Set<String> blackList = new HashSet<String>();

        try (BufferedReader br = new BufferedReader(new FileReader(new File(blackListPath)))) {
            for (String line; (line = br.readLine()) != null;) {
                String s = line.trim().toLowerCase();

                blackList.add(s);//from w ww.  jav a 2 s  .c  o  m
            }
        }

        return blackList;
    }
}

Related

  1. loadAddressList(String filename)
  2. loadAFileToString2(File f)
  3. loadAPIKey(InputStream in)
  4. loadAuthFile(String fileName)
  5. loadBase64Object(BufferedReader rdr, String type)
  6. loadBussinessGroupCompanies(String file_path)
  7. loadByUsingSplit(String filename)
  8. loadClob(File f, String enc)
  9. loadCommonMisspellingsFile(String commonMisspellingsFileLocation)