Class RequestHandler


  • public class RequestHandler
    extends Object
    • Constructor Detail

      • RequestHandler

        public RequestHandler()
    • Method Detail

      • getProgress

        @NotNull
        public static @NotNull String getProgress​(String uri,
                                                  int scanId,
                                                  Secret apiKey)
                                           throws IOException
        Get Scan Progress.
        Parameters:
        uri - the uri
        scanId - the scan id
        apiKey - the api key
        Returns:
        the string
        Throws:
        IOException - the io exception
      • getRisk

        @NotNull
        public static @NotNull String getRisk​(String uri,
                                              int scanId,
                                              Secret apiKey)
                                       throws IOException
        Get Scan Global risk.
        Parameters:
        uri - the uri
        scanId - the scan id
        apiKey - the api key
        Returns:
        the string
        Throws:
        IOException - the io exception
      • check

        @NotNull
        public static @NotNull String check​(String uri,
                                            Secret apiKey)
                                     throws IOException
        Check string.
        Parameters:
        uri - the uri
        apiKey - the api key
        Returns:
        the string
        Throws:
        IOException - the io exception
      • runRequest

        @NotNull
        public static @NotNull String runRequest​(String uri,
                                                 Secret apiKey,
                                                 String input)
                                          throws IOException
        Run request string.
        Parameters:
        uri - the uri
        apiKey - the api key
        input - the input
        Returns:
        the string
        Throws:
        IOException - the io exception
      • upload

        @NotNull
        public static @NotNull String upload​(String uri,
                                             Secret apiKey,
                                             String fileName,
                                             byte[] fileContent,
                                             String scanProfile,
                                             String platform,
                                             Integer scanCredential)
                                      throws IOException
        Upload string.
        Parameters:
        uri - the uri
        apiKey - the api key
        fileContent - the file
        fileName - the file
        scanProfile - the scanProfile
        platform - the platform
        Returns:
        the string
        Throws:
        IOException - the io exception
      • createTestCredential

        @NotNull
        public static @NotNull String createTestCredential​(String uri,
                                                           List<Credentials> credential,
                                                           Secret apiKey)
                                                    throws IOException
        Call API to create Test credentials.
        Parameters:
        uri - The API url
        credential - the list os credentials to add
        apiKey - the api key to authenticate
        Returns:
        the response string
        Throws:
        IOException - the io exception