vagrant.impl.cli.BoxImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vagrant-java-bindings Show documentation
Show all versions of vagrant-java-bindings Show documentation
Wrapper over the CLI Vagrant tool presented in a Java API
package vagrant.impl.cli;
import java.io.File;
import java.util.Collection;
import vagrant.api.BoxApi;
import vagrant.api.domain.Box;
import vagrant.api.option.BoxAddOptions;
import vagrant.impl.cli.parser.BoxListParser;
public class BoxImpl implements BoxApi {
private File path;
public BoxImpl(File path) {
this.path = path;
}
@Override
public void add(String name, BoxAddOptions options) {
new VagrantCli(path)
.arg("box")
.arg("add")
.arg(name)
.machineReadable()
.execute();
}
@Override
public Collection list() {
String out = new VagrantCli(path)
.arg("box")
.arg("list")
.machineReadable()
.execute();
return new BoxListParser().parse(out);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy