Java URL Load load(URL pUrl)

Here you can find the source of load(URL pUrl)

Description

load

License

Open Source License

Declaration

public static List<String> load(URL pUrl) throws IOException 

Method Source Code


//package com.java2s;
import java.io.*;
import java.util.List;
import java.util.ArrayList;
import java.net.URL;

public class Main {
    public static List<String> load(URL pUrl) throws IOException {
        final InputStream is = pUrl.openStream();
        final BufferedReader reader = new BufferedReader(new InputStreamReader(is));
        final List<String> lines = new ArrayList<String>();

        try {/*ww  w .ja va2 s .c o  m*/
            String line = null;

            while ((line = reader.readLine()) != null) {
                lines.add(line);
            }

            return lines;
        } finally {
            reader.close();
        }
    }
}

Related

  1. findResourcesFromJar(Collection urls, URL url, String resource, ClassLoader cl)
  2. getBundle(String basename, Locale locale, ClassLoader cl, URL url)
  3. getManifestAsString(URLClassLoader cl, String jarBaseName)
  4. load(Iterable urls)
  5. load(String fileOrURL)
  6. load(URL url)
  7. load(URL url)
  8. load(URL url, boolean allowCache)
  9. loadByteArray(URL url)