Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static boolean skipByJIRA(String task) {
- ApplicationManager ap = ApplicationManager.getInstance();
- URL jiraURL = null;
- HttpURLConnection connection = null;
- try {
- jiraURL = new URL(ap.getProperty("jira.url").concat("/rest/api/2/issue/").concat(task));
- if (auth == null) {
- String user = ap.getProperty("jira.login");
- String pass = ap.getProperty("jira.pass");
- if (user == null || user.isEmpty() || pass == null || pass.isEmpty()) return false;
- auth = user.concat(":").concat(pass);
- auth = "Basic ".concat(Base64.getEncoder().encodeToString(auth.getBytes()));
- }
- connection = (HttpURLConnection) jiraURL.openConnection();
- connection.setRequestProperty("Authorization", auth);
- connection.setRequestMethod("GET");
- connection.setRequestProperty("Content-Type", "application/json");
- // connection.connect();
- } catch (Exception ignored) {
- ignored.printStackTrace();
- } finally {
- if (connection != null) connection.disconnect();
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement