Package com.jsql.util
Class GitUtil
java.lang.Object
com.jsql.util.GitUtil
Utility class used to connect to GitHub Rest webservices.
It uses jsql-robot profile to post data to GitHub.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Define explicit labels to declare method parameters. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkUpdate
(GitUtil.ShowOnConsole displayUpdateMessage) Verify if application is up-to-date against the version on GitHub.org.json.JSONObject
Instantiate the jsonObject from json data if not already set.void
sendReport
(String reportBody, GitUtil.ShowOnConsole showOnConsole, String reportTitle) Connect to GitHub webservices and create an Issue on the repository.void
sendUnhandledException
(String threadName, Throwable throwable) Define the body of an issue to send to GitHub for an unhandled exception.void
showNews()
Displays news information on the console from GitHub web service.
-
Constructor Details
-
GitUtil
-
-
Method Details
-
checkUpdate
Verify if application is up-to-date against the version on GitHub.- Parameters:
displayUpdateMessage
- YES for manual update verification, hidden otherwise
-
sendUnhandledException
Define the body of an issue to send to GitHub for an unhandled exception. It adds different system data to the body and remove sensible data like injection URL.- Parameters:
threadName
- name of thread where the exception occurredthrowable
- unhandled exception to report to GitHub
-
sendReport
Connect to GitHub webservices and create an Issue on the repository. Used by translation protocol, unhandled exception detection and manual Issue reporting.- Parameters:
reportBody
- text of the IssueshowOnConsole
- in case of manual Issue reporting. Hidden in case of automatic reporting of unhandled exception.reportTitle
- title of the Issue
-
showNews
public void showNews()Displays news information on the console from GitHub web service. Infos concern the general roadmap for the application, current development status and other useful statements for the community. -
getJSONObject
public org.json.JSONObject getJSONObject()Instantiate the jsonObject from json data if not already set.- Returns:
- jsonObject describing json data
-