Java program - over the net arguments

Hi Friends,

I have a java program that accepts inputs as agruments and produces a result file eg:

java MyProgram input1.wav input2.wav output.wav

The program works fine if the input files are on local computer but i want the input files to come over the internet eg:

java MyProgram http://www.xyz.com/input1.wav http://www.xyz.com/input2.wav http://www.xyz.com/output.wav

Can someone please tell me how to do this. I tried to make a servlet that calls this java program but it didn't worked...

Please give me some ideas as to how to implement this..

Thanks

[637 byte] By [java80a] at [2007-11-27 10:37:43]
# 1

Download the files to your PC first.

prometheuzza at 2007-7-28 18:50:07 > top of Java-index,Java Essentials,Java Programming...
# 2

I haven't worked with wav files before, but I do know one way to get data from the internet.

URL url = new URL(" http://www.xyz.com");

InputStream in = url.openStream();

Then you can read the data in.

Helpful?

atroutta at 2007-7-28 18:50:07 > top of Java-index,Java Essentials,Java Programming...
# 3

I would like to make an API, so that when the program gets the parameters,it automatically downloads and processes them and then provides the output file?

Do,I need to establish a HTTP connection to that server first from which I need to access the files?

java80a at 2007-7-28 18:50:07 > top of Java-index,Java Essentials,Java Programming...
# 4

> I would like to make an API, so that when the program

> gets the parameters,it automatically downloads and

> processes them and then provides the output file?

>

> Do,I need to establish a HTTP connection to that

> server first from which I need to access the files?

Have a look at Sun's lesson: Working with URLs:

http://java.sun.com/docs/books/tutorial/networking/urls/index.html

prometheuzza at 2007-7-28 18:50:07 > top of Java-index,Java Essentials,Java Programming...
# 5

Thanks a lot,

I would surely look into that....and try to figure out how to download the files.

Thanks Again

java80a at 2007-7-28 18:50:07 > top of Java-index,Java Essentials,Java Programming...
# 6

I went over that tutorial and it was really good but it just showed how to handle text files and write output to standard out.....

Did some search on google, and got this link for binary file handling:

http://www.smartdataprocessing.com/lessons/l10.htm

I hope it would help other fellow mates.

Thanks guys

java80a at 2007-7-28 18:50:07 > top of Java-index,Java Essentials,Java Programming...