>
> I am out of ideas and really need help on this one...
>
> I need to access a URL from an application and capture the
> output for further processing by the application.
try:
URL u = new URL(args[0]);
URLConnection urlc = u.openConnection();
in = new DataInputStream(urlc.getInputStream());
if (args.length >1)
out = new FileOutputStream(args[1]);
else
out = System.out;
byte[] buffer = new byte[16384];
int bytes_read;
while ((bytes_read = in.read(buffer)) != -1){
out.write(buffer, 0, bytes_read);
}
from (mostly) Java Examples in an Nutshell (O'Reilly)
this works accessing a servlet (or whatever) from an application so it
should work for you.
JDK 1.17a
>
-- --------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]