Class WrapperUtil


  • public class WrapperUtil
    extends Object
    The WrapperUtil class contains the helpers for using wrappers.
    • Constructor Detail

      • WrapperUtil

        public WrapperUtil()
    • Method Detail

      • setupCredential

        public static final void setupCredential​(com.veracode.apiwrapper.AbstractAPIWrapper wrapper,
                                                 String id,
                                                 String key)
        Setup the credential of a wrapper.
        Parameters:
        wrapper - a AbstractAPIWrapper object - the target wrapper to set the credential.
        id - a String object - the Veracode API ID.
        key - a String object - the Veracode API key.
      • setupProxy

        public static final void setupProxy​(com.veracode.apiwrapper.AbstractAPIWrapper wrapper,
                                            ProxyBlock proxyInfo)
        Setup proxy settings of a wrapper.
        Parameters:
        wrapper - a AbstractAPIWrapper object - the target wrapper to set the proxy settings.
        proxyInfo - a ProxyBlock object - the proxy settings.
      • getBuildInfo

        public static final String getBuildInfo​(String appName,
                                                String sandboxName,
                                                String id,
                                                String key,
                                                ProxyBlock proxy)
                                         throws Exception
        Get the latest build info of an application.
        Parameters:
        appName - a String object - the target application.
        sandboxName - a String object - the name of the sandbox being used for this build. It could be null or empty.
        id - a String object - the Veracode API ID.
        key - a String object - the Veracode API key.
        proxy - a ProxyBlock object - the proxy settings. Use null if no proxy is required.
        Returns:
        a String object - the ID of the latest build of the given application.
        Throws:
        Exception - when an error is encountered during the process.
      • getBuildInfoByAppIdBuildId

        public static final String getBuildInfoByAppIdBuildId​(String appId,
                                                              String buildId,
                                                              String id,
                                                              String key,
                                                              ProxyBlock proxy)
                                                       throws Exception
        Get the build information for a given build id.
        Parameters:
        appId - a String object - the target application ID.
        buildId - a String object - the target build ID.
        id - a String object - the Veracode API ID.
        key - a String object - the Veracode API key.
        proxy - a ProxyBlock object - the proxy settings. Use null if no proxy is required.
        Returns:
        a String object - build info XML of the given application ID and build ID.
        Throws:
        Exception - when an error is encountered during the process.
      • getDetailedReport

        public static final String getDetailedReport​(String buildId,
                                                     String id,
                                                     String key,
                                                     ProxyBlock proxy)
                                              throws Exception
        Get the detailed report of a given build (by ID).
        Parameters:
        buildId - a String object - the ID of a build.
        id - a String object - the Veracode API ID.
        key - a String object - the Veracode API key.
        proxy - a ProxyBlock object - the proxy settings. Use null if no proxy is required.
        Returns:
        a String object - the detailed report in XML.
        Throws:
        Exception - when an error is encountered during the process.
      • getSandboxList

        public static final String getSandboxList​(String appId,
                                                  String id,
                                                  String key,
                                                  ProxyBlock proxy)
                                           throws Exception
        Get the list of sandbox of a given application.
        Parameters:
        appId - a String object - the ID of an application.
        id - a String object - the Veracode API ID.
        key - a String object - the Veracode API key.
        proxy - a ProxyBlock object - the proxy settings. Use null if no proxy is required.
        Returns:
        a String object - the sandbox list in XML.
        Throws:
        Exception - when an error is encountered during the process.
      • getSummaryReport

        public static final String getSummaryReport​(String buildId,
                                                    String id,
                                                    String key,
                                                    ProxyBlock proxy)
                                             throws Exception
        Get the summary report of a given build (by ID).
        Parameters:
        buildId - a String object - the ID of a build.
        id - a String object - the Veracode API ID.
        key - a String object - the Veracode API key.
        proxy - a ProxyBlock object - the proxy settings. Use null if no proxy is required.
        Returns:
        a String object - the summary report in XML.
        Throws:
        Exception - when an error is encountered during the process.