Java URL Load loadFileNoArray(URL f)

Here you can find the source of loadFileNoArray(URL f)

Description

load File No Array

License

Open Source License

Declaration

public static ArrayList<String> loadFileNoArray(URL f) 

Method Source Code


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

import java.io.BufferedReader;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;

public class Main {
    public static ArrayList<String> loadFileNoArray(URL f) {
        ArrayList<String> temp = new ArrayList<>();

        BufferedReader br;/*from   w ww. j  a  v  a 2s .c  o  m*/
        try {
            br = new BufferedReader(new InputStreamReader(f.openStream()));

            String strLine;

            while ((strLine = br.readLine()) != null) {

                if (strLine.equals(""))
                    continue;

                temp.add(strLine);

            }

            br.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return temp;
    }
}

Related

  1. load(URL url, boolean allowCache)
  2. loadByteArray(URL url)
  3. loadFile(String url)
  4. loadFile(URL resource)
  5. loadFile(URL url)
  6. loadFileOrUrlToList(String iFileOrUrl)
  7. loadFromUrl(String url)
  8. loadFromURL(URL url)
  9. loadFromURL(URL url)