use of org.commonjava.indy.bind.jaxrs.util.ResponseUtils.formatResponse in project indy by Commonjava.
the class RevisionsAdminResource method pushDataGitUpdates.
@ApiOperation("Push Indy data directory content to the configured remote Git repository (if configured in the [revisions] section)")
@ApiResponse(code = 200, message = "Push complete, or not configured")
@Path("/data/push")
@GET
public Response pushDataGitUpdates() {
Response response;
try {
revisionsManager.pushDataUpdates();
// FIXME: Return some status
response = Response.ok().build();
} catch (final GitSubsystemException e) {
logger.error("Failed to push git updates for data dir: " + e.getMessage(), e);
response = ResponseUtils.formatResponse(e, "Failed to push git updates for data dir: " + e.getMessage());
}
return response;
}
use of org.commonjava.indy.bind.jaxrs.util.ResponseUtils.formatResponse in project indy by Commonjava.
the class RevisionsAdminResource method pullDataGitUpdates.
@ApiOperation("Pull from the configured remote Git repository, updating the Indy data directory with files (merged according to configuration in the [revisions] section)")
@ApiResponse(code = 200, message = "Pull complete")
@Path("/data/pull")
@GET
public Response pullDataGitUpdates() {
Response response;
try {
revisionsManager.pullDataUpdates();
// FIXME: Return some status
response = Response.ok().build();
} catch (final GitSubsystemException e) {
logger.error("Failed to pull git updates for data dir: " + e.getMessage(), e);
response = ResponseUtils.formatResponse(e, "Failed to pull git updates for data dir: " + e.getMessage());
}
return response;
}
Aggregations