468,768 Members | 1,452 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,768 developers. It's quick & easy.

Problem with reading files and writing to a file without overwriting

I'm really new in java. I'm trying to read 8000 URL files and write to a file. It's a kind of combining all files together...not overwritten.
This is the URL of my all files http://www.ifi.unizh.ch/ddis/ph/2006/08/ ...
These files are .owl....and I store all of them in a directory. This is source code java that i wrote...it doesnt work as I want.... In fact, I just dont know how to call the files directly from the URL ... Please advice.

import java.io.*;
public class Test {

public static void main(String[] args) throws IOException {

// create two file references
File inputFile = new File("D:/ANALYSIS.owl");
File outputFile = new File("D:/ProcessHandbook0.owl");

// create two File Streams
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);

// read one file and write it out to another
int c;

while ((c = in.read()) != -1)
out.write(c);

// close both files
in.close();
out.close();
}
}
Oct 10 '07 #1
0 1492

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Brandon McCombs | last post: by
4 posts views Thread by Oliver Knoll | last post: by
7 posts views Thread by Kay | last post: by
11 posts views Thread by Abhishek | last post: by
6 posts views Thread by arne.muller | last post: by
5 posts views Thread by Neil Crighton | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.