Java URL Connection getLength(String htmlUrl)

Here you can find the source of getLength(String htmlUrl)

Description

get Length

License

Apache License

Declaration

public static int getLength(String htmlUrl) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;

import java.net.URL;
import java.net.URLConnection;

public class Main {
    public static int getLength(String htmlUrl) throws IOException {
        URL url = new URL(htmlUrl);
        URLConnection con = url.openConnection();
        return con.getContentLength();
    }/*from   w  w w .j ava 2s.co m*/
}

Related

  1. getImageFromURL(String remoteURL)
  2. getJar(String jarUrl)
  3. getJarUrlForPackage(String packageName)
  4. getLastModified(URL url)
  5. getLastModified(URLConnection connection)
  6. getLines(final URL url, final int linesToRead)
  7. getOutputStream(final URL outputURL)
  8. getOutputStream(URL url)
  9. getPage(String url)