Saiyine
Punto Com

To read data from an URL with JAVA

2007-03-05 04:20:33

To read the data inside a file from the Web with Java is fairly easy. Just create an URL object (remember to import java.io.* to have it avaliable for your code) and tunnel its stream to the usual InputStreamReader.

Just be aware that it doesn't seem to support HTTP authentication!

import java.net.*;
import java.io.*;

public class URLReader
{
  public static void main(String[] args) throws Exception
  {
    URL pagina = new URL("http://www.google.com/");
    BufferedReader in = new BufferedReader
         (new InputStreamReader(pagina.openStream()));
    String entrada;
    while ((entrada = in.readLine()) != null)
      System.out.println(entrada);
    in.close();
    }
}

Rollos antiguos

2007-03-05 04:19:46 - Leer datos de una URL en java.

2007-02-16 04:43:56 - Google Adwords.

2007-02-08 09:43:17 - Ganando dinero gracias a Paypal.

2007-02-01 01:53:13 - Más imagenes de los Transformers, la pelicula.

2007-02-01 12:47:03 - Extraño en tierra extraña.

Saiyine

Selfie of meHi! Welcome to Saiyine Punto Com where I talk about anything that goes through my mind!

Puedo prometer y prometo que a la mayor brevedad aquí irá un menú o algo asín.