Search the web
Sign In
New User? Sign Up
jsci
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
AutoUpdate   Message List  
Reply | Forward Message #72 of 369 |
Re: [jsci] AutoUpdate

On Mon, 20 May 2002, anthonyjbarbaro wrote:


> Is the AutoUpdate source available?
>

Yep, find it attached.

Mark



Mon May 20, 2002 1:03 pm

m.hale@...
Send Email Send Email

import java.io.*;
import java.net.*;
import JSci.Version;


public final class AutoUpdate {
private final static String zipfile="JSci.zip";
private final static String email="support@...";
private URL url;

public static void main(String arg[]) {
System.out.println("Current version:
"+Version.current.toString());
System.out.println("Checking for a later version...");
try {
final Version latest=Version.getLatest();
System.out.println("Latest version:
"+latest.toString());
if(latest.isLater()) {
System.out.print("Downloading latest
version...");
AutoUpdate app=new AutoUpdate();
app.getLatestVersion();
System.out.println("done.");
}
} catch(IOException e) {
System.out.println("\nError transfering data - try again
or contact "+email+" directly.");
}
}
private AutoUpdate() {
try {
url=new URL(Version.current.versionURL+zipfile);
} catch(MalformedURLException e) {}
}
private void getLatestVersion() throws IOException {
final OutputStream out=new FileOutputStream(zipfile);
final InputStream in=url.openStream();
byte buf[]=new byte[in.available()];
while(buf.length>0) {
in.read(buf);
out.write(buf);
buf=new byte[in.available()];
}
in.close();
out.close();
}
}


Forward
Message #72 of 369 |
Expand Messages Author Sort by Date

Is the AutoUpdate source available?...
anthonyjbarbaro
anthonyjbarbaro@...
Send Email
May 20, 2002
8:03 am

On Mon, 20 May 2002, anthonyjbarbaro wrote: > Is the AutoUpdate source available? > Yep, find it attached. Mark import java.io.*; import java.net.*; ...
Mark Hale
m.hale@...
Send Email
May 20, 2002
1:03 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help