Read a submission from the specified URL.

@param url URL, must not be null
@return a submission read from the specified URL
@throws IOException if an I/O error occurs
968653
public static Submission readSubmission(final URL url) throws IOException {
        checkNotNull(url);
        try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
            return readSubmission(reader);
        }
    }
632802
public static String readUrlContent( String url )
	throws IOException, URISyntaxException {

		InputStream in = null;
		try {
			URI uri = UriUtils.urlToUri( url );
			in = uri.toURL().openStream();
			ByteArrayOutputStream os = new ByteArrayOutputStream();

			Utils.copyStreamSafely( in, os );
			return os.toString( "UTF-8" );

		} finally {
			closeQuietly( in );
		}
	}
1364476
public Response download(String url, File destination) throws IOException {
		return download(url, destination, (String[]) null);
	}
721571
public static BufferedImage read(URL imageUrl) {
		try {
			return ImageIO.read(imageUrl);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
	}
633924
public static String readStringFromUrlGeneric(String url)
            throws IOException {
        InputStream is = null;
        URL urlObj = null;
        String responseString = PcConstants.NA;
        try {
            urlObj = new URL(url);
            URLConnection con = urlObj.openConnection();

            con.setConnectTimeout(ParallecGlobalConfig.urlConnectionConnectTimeoutMillis);
            con.setReadTimeout(ParallecGlobalConfig.urlConnectionReadTimeoutMillis);
            is = con.getInputStream();

            BufferedReader rd = new BufferedReader(new InputStreamReader(is,
                    Charset.forName("UTF-8")));
            responseString = PcFileNetworkIoUtils.readAll(rd);

        } finally {

            if (is != null) {
                is.close();
            }

        }

        return responseString;
    }
867230
public static JSONObject getJSONFromUrlViaGET(String url) {

        JSONObject jObj = null;

        StringBuilder builder = new StringBuilder();
        HttpClient client = new DefaultHttpClient();
        HttpGet httpGet = new HttpGet(url);
        try {
            HttpResponse response = client.execute(httpGet);
            StatusLine statusLine = response.getStatusLine();
            int statusCode = statusLine.getStatusCode();
            if (statusCode == 200) {
                HttpEntity entity = response.getEntity();
                InputStream content = entity.getContent();
                BufferedReader reader = new BufferedReader(new InputStreamReader(content));
                String line;
                while ((line = reader.readLine()) != null) {
                    builder.append(line);
                }

                jObj = new JSONObject(builder.toString());
            } else {
                // Log.e(ParseJSON.class.toString(), "Failed to download file");
            }
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return jObj;
    }
91497
public final MediaStatus load(String url) throws IOException {
        return load(url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.')), null, url, null);
    }
465554
public static String read(URL url, String encoding) throws IOException {
        Reader reader = getReader(url, encoding);
        String source;
        try {
            source = read(reader);
        } finally {
            reader.close();
        }
        return source;
    }
566254
def url_read(url, verbose=True):
    
    """
    if url.find('://') == -1:
        url = 'http://' + url
    if verbose:
        print('Reading data from url=%r' % (url,))
    try:
        file_ = _urllib.request.urlopen(url)
        #file_ = _urllib.urlopen(url)
    except IOError:
        raise
    data = file_.read()
    file_.close()
    return data
204155
public Table url(URL url) throws IOException {
	URLConnection connection = url.openConnection();
	String contentType = connection.getContentType();
	String[] pair = contentType.split(";");
	String mimeType = pair[0].trim();
	Charset charset = pair.length == 0 ? Charset.defaultCharset() : Charset.forName(pair[1].split("=")[1].trim());
	DataReader<?> reader = registry.getReaderForMimeType(mimeType);
	return reader.read(new Source(connection.getInputStream(), charset));
    }
475764
public static String getContent(String stringUrl, Map<String, String> parameters)
      throws IOException {
    return getContent(stringUrl, parameters, null);
  }
513669
public static Submission readSubmission(final File file) throws IOException {
        checkNotNull(file);
        try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
            return readSubmission(reader);
        }
    }
436338
public static String readUrlContentQuietly( String url, Logger logger ) {

		String result = "";
		try {
			result = readUrlContent( url );

		} catch( Exception e ) {
			logger.severe( "Content of URL " + url + " could not be read." );
			logException( logger, e );
		}

		return result;
	}
110895
public static InputStream getInputStreamFromHttp(String httpFileURL) throws IOException {

        URLConnection urlConnection = null;
        urlConnection = new URL(httpFileURL).openConnection();
        urlConnection.connect();
        return urlConnection.getInputStream();
    }
20705
public static byte[] getBytes(URL url) throws IOException {
        final String path = url.getPath();
        final File file = new File(path);
        if (file.exists()) {
            return getFileBytes(file);
        }

        return null;
    }
548557
public static org.jsoup.nodes.Document getDocumentFromUrl(String url) throws IOException {
        return Jsoup.connect(url).get();
    }
1003629
public Reader create( URL url ) throws IOException {
        return new InputStreamReader( openStream( url ), StandardCharsets.UTF_8 );
    }