журнал закрыт (ex_juan_gan) wrote in myjavatools,
журнал закрыт
ex_juan_gan
myjavatools

two new methods for Files class

Got a letter:

"I was trying your files utility on http://myjavatools.com/ & found the methods very useful. Was wondering why following were not considered as another install method ?

public static boolean install(String archiveName, File location) throws IOException
{
URL url = new URL(archiveName);
ZipInputStream is = new ZipInputStream(url.openStream());
return unzip(is,location);
}

public static boolean install(String archiveName, String location) throws IOException
{
URL url = new URL(archiveName);
ZipInputStream is = new ZipInputStream(url.openStream());
return unzip(is,new File(location));
}

Where archiveName could be something like : file:/C:/downloads/examples.jar (or a zip file), as this eliminates the creation of the 'Class' object required for the existing install methods.

Looking forward to hearing from you...

Regards,

Rajeev Chugh"

It's a great idea; and I've just added these two methods.
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments