#wget #java #libwgetj

libwgetj

Library for using wget to grab Java distributions

17 releases (6 stable)

1.0.5 Apr 26, 2017
1.0.4 Jan 20, 2017
1.0.3 Jul 26, 2016
0.1.11 Feb 10, 2016
0.1.2 Mar 30, 2015

#59 in Parser implementations

Download history 34/week @ 2018-08-10 4/week @ 2018-08-17 18/week @ 2018-08-24 3/week @ 2018-08-31 21/week @ 2018-09-07 2/week @ 2018-09-14 1/week @ 2018-09-21 34/week @ 2018-09-28 37/week @ 2018-10-05 1/week @ 2018-10-12 20/week @ 2018-10-19 69/week @ 2018-11-02

55 downloads per month
Used in 1 crate

MIT license

46KB
927 lines

libwgetj

Library wrapping wget to grab Java distributions.

Version

Crates.io Build Status


lib.rs:

libwgetj API

Wraps wget with some cookie management to allow downloading Java releases from the command line.

Examples

use libwgetj::{DownloadConfig, latest};
use libwgetj::Arch::*;
use libwgetj::Archive::*;
use libwgetj::OS::*;
use libwgetj::Package::*;
use libwgetj::Version::*;

// Setup a dry run (don't actually download) for the default Java 8 JDK 64-bit Linux tar.gz
// (latest point release).
let mut cfg: DownloadConfig = Default::default();
cfg.dry_run(true);
match cfg.download() {
    Ok(res) => assert!(res == 0),
    Err(e)  => { println!("{:?}", e); assert!(false) },
}

// Download Java 8 JDK 64-bit Linux tar.gz (older point release).
let mut cfg: DownloadConfig = Default::default();
cfg.point_release(40).dry_run(true);
match cfg.download() {
    Ok(res) => assert!(res == 0),
    Err(e)  => { println!("{:?}", e); assert!(false) },
}

// Download Java 8 JDK 64-bit Mac OSX dmg (latest point release).
let mut cfg: DownloadConfig = Default::default();
cfg.archive(DMG).os(Mac).dry_run(true);
match cfg.download() {
    Ok(res) => assert!(res == 0),
    Err(e)  => { println!("{:?}", e); assert!(false) },
}

// Download Java 8 JDK 32-bit Windows exe (latest point release).
let mut cfg: DownloadConfig = Default::default();
cfg.archive(EXE).os(Windows).arch(I586).dry_run(true);
match cfg.download() {
    Ok(res) => assert!(res == 0),
    Err(e)  => { println!("{:?}", e); assert!(false) },
}

// Download Java 8 JRE 32-bit Linux rpm (latest point release).
let mut cfg: DownloadConfig = Default::default();
cfg.archive(RPM).arch(I586).package(JRE).dry_run(true);
match cfg.download() {
    Ok(res) => assert!(res == 0),
    Err(e)  => { println!("{:?}", e); assert!(false) },
}

// Download Java 7 JDK 64-bit Linux tar.gz (latest point release).
let mut cfg: DownloadConfig = Default::default();
cfg.version(Seven).point_release(latest(Seven)).dry_run(true);
match cfg.download() {
    Ok(res) => assert!(res == 0),
    Err(e)  => { println!("{:?}", e); assert!(false) },
}

Dependencies

~157KB

  • build build.rs
  • build vergen 0.1.0