Java URL Load readLines(final String url)

Here you can find the source of readLines(final String url)

Description

read Lines

License

Open Source License

Declaration

public static final String readLines(final String url) throws IOException 

Method Source Code


//package com.java2s;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;

public class Main {
    public static final String readLines(final String url) throws IOException {
        return readLines(new URL(url));
    }/*w w  w  .j a  va 2 s .c om*/

    public static final String readLines(final URL url) throws IOException {
        final InputStream stream = url.openStream();
        final BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
        String lines = "";
        String line;
        while ((line = reader.readLine()) != null)
            lines += line;
        reader.close();
        stream.close();
        return lines;
    }
}

Related

  1. readGOMappingFile(URL filename, Set secondAttributeList)
  2. readHttpBytes(String url)
  3. readHttpFile(final String urlStr)
  4. readInteger(URL src, int radix)
  5. readJsonFromUrl(String urlString)
  6. readLines(final URL url)
  7. readLines(URL url)
  8. readLinesTrimmedNoCommentFromUrl(final URL fileUrl, final String commentString)
  9. readListFile(URL listFile)

  10. HOME | Copyright © www.java2s.com 2016