Class Helper


  • public class Helper
    extends Object
    • Constructor Detail

      • Helper

        public Helper()
    • Method Detail

      • getOneTimeToken

        public static String getOneTimeToken​(URL ctfUrl,
                                             String accessToken)
                                      throws IOException
        Gets OneTimeToken for given acess token
        Parameters:
        accessToken - the access token
        Throws:
        IOException
      • getSessionId

        public static String getSessionId​(URL ctfUrl,
                                          String oneTimeToken)
                                   throws IOException
        Get session id for given OneTimeToken
        Parameters:
        ctfUrl - the ctf url
        oneTimeToken - the one time token
        Throws:
        IOException
      • markUnstable

        public static void markUnstable​(Run build,
                                        PrintStream consoleLogger,
                                        String message,
                                        String className)
        Marks the build as unstable and logs a message.
        Parameters:
        build - the build to mark unstable
        consoleLogger - the logger to log to
        message - the message to log
      • log

        public static void log​(String msg,
                               PrintStream printStream)
        Logging helper that prepends the log message prefix
        Parameters:
        msg - log message
        printStream - print stream
      • getCredentials

        public static com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials getCredentials​(Item owner,
                                                                                                                  String credentialsId,
                                                                                                                  String webhookUrl)
      • lookupCredentials

        public static List<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials> lookupCredentials​(Item owner,
                                                                                                                           String webhookUrl)
      • getErrorMessage

        public static String getErrorMessage​(String messageJson)