Results 1 to 2 of 2
  1. #1
    Googleauk is offline Banned
    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Default Java Double URL Reader?

    Can Anyone Help me with the java url reader. I have created an url reader with java that read the link and send it to a specific file. How can i make the code to read from two URL's and save it to a specific file ?

    Java Code:
    import java.net.*;
    import java.io.*;
    
    public class URLReader {
    
    public static void main(String[] args) throws Exception {
    
        URL oracle = new URL("http://www.oracle.com/");
        URLConnection yc = oracle.openConnection();
        BufferedReader in = new BufferedReader(new InputStreamReader(
        yc.getInputStream()));
    
        String inputLine;
        BufferedWriter psout = new BufferedWriter(new FileWriter("D:\\final.txt"));
        while ((inputLine = in.readLine()) != null) {
        psout.write(inputLine);
        System.out.println(inputLine);
        }
        in.close();
        psout.close();
       }
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Java Double URL Reader?

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Converting C File reader to Java
    By dvreed77 in forum Advanced Java
    Replies: 2
    Last Post: 02-05-2012, 02:54 PM
  2. Trouble with Java File Reader
    By name in forum New To Java
    Replies: 3
    Last Post: 12-17-2011, 01:25 AM
  3. Java Database Application with Barcode Reader
    By razmyasdfg in forum JDBC
    Replies: 20
    Last Post: 06-09-2011, 07:29 PM
  4. [help] Java text reader
    By gundum584 in forum Advanced Java
    Replies: 8
    Last Post: 05-26-2010, 07:44 PM
  5. Java file reader...?
    By prabhurangan in forum New To Java
    Replies: 3
    Last Post: 11-21-2008, 09:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •