import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
public class UrlHit {
public static void main(String args[])
{
try {
URL cricurl = new URL("http://codeforjava.blogspot.com/2008/06/method-for-copying-only-files-from-one.html");
URLConnection criccon = cricurl.openConnection();
criccon.connect();
BufferedReader br = new BufferedReader(new InputStreamReader(cricurl.openStream()));
String s="";
String strTemp="";
while((strTemp=br.readLine()) != null)
{
strTemp = br.readLine();
s=s.concat(strTemp);
}
s=s.trim();
System.out.println("Got url content - "+s);
} catch (Exception e)
{
e.printStackTrace();
}
}
}
Wednesday, July 2, 2008
Subscribe to:
Post Comments (Atom)
1 comments:
really helpful
Post a Comment