use of org.locationtech.geogig.api.porcelain.VersionInfo in project GeoGig by boundlessgeo.
the class VersionWebOp method run.
/**
* Runs the command and builds the appropriate response.
*
* @param context - the context to use for this command
*/
@Override
public void run(CommandContext context) {
final Context geogig = this.getCommandLocator(context);
final VersionInfo info = geogig.command(VersionOp.class).call();
context.setResponseContent(new CommandResponse() {
@Override
public void write(ResponseWriter out) throws Exception {
out.start();
out.writeElement("ProjectVersion", info.getProjectVersion());
out.writeElement("BuildTime", info.getBuildTime());
out.writeElement("BuildUserName", info.getBuildUserName());
out.writeElement("BuildUserEmail", info.getBuildUserEmail());
out.writeElement("GitBranch", info.getBranch());
out.writeElement("GitCommitID", info.getCommitId());
out.writeElement("GitCommitTime", info.getCommitTime());
out.writeElement("GitCommitAuthorName", info.getCommitUserName());
out.writeElement("GitCommitAuthorEmail", info.getCommitUserEmail());
out.writeElement("GitCommitMessage", info.getCommitMessageFull());
out.finish();
}
});
}
use of org.locationtech.geogig.api.porcelain.VersionInfo in project GeoGig by boundlessgeo.
the class Version method run.
/**
* Executes the version command.
*
* @param cli
* @see org.locationtech.geogig.cli.CLICommand#run(org.locationtech.geogig.cli.GeogigCLI)
*/
public void run(GeogigCLI cli) {
GeoGIG geogig = cli.getGeogig();
if (geogig == null) {
geogig = new GeoGIG();
}
this.console = cli.getConsole();
VersionInfo info = geogig.command(VersionOp.class).call();
try {
printVersionProperty("Project Version", info.getProjectVersion());
printVersionProperty("Build Time", info.getBuildTime());
printVersionProperty("Build User Name", info.getBuildUserName());
printVersionProperty("Build User Email", info.getBuildUserEmail());
printVersionProperty("Git Branch", info.getBranch());
printVersionProperty("Git Commit ID", info.getCommitId());
printVersionProperty("Git Commit Time", info.getCommitTime());
printVersionProperty("Git Commit Author Name", info.getCommitUserName());
printVersionProperty("Git Commit Author Email", info.getCommitUserEmail());
printVersionProperty("Git Commit Message", info.getCommitMessageFull());
} catch (IOException e) {
Throwables.propagate(e);
}
}
Aggregations