Class WrapperUtil
- java.lang.Object
-
- com.veracode.jenkins.plugin.utils.WrapperUtil
-
public class WrapperUtil extends Object
The WrapperUtil class contains the helpers for using wrappers.
-
-
Constructor Summary
Constructors Constructor Description WrapperUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getBuildInfo(String appName, String sandboxName, String id, String key, ProxyBlock proxy)
Get the latest build info of an application.static String
getBuildInfoByAppIdBuildId(String appId, String buildId, String id, String key, ProxyBlock proxy)
Get the build information for a given build id.static String
getDetailedReport(String buildId, String id, String key, ProxyBlock proxy)
Get the detailed report of a given build (by ID).static String
getSandboxList(String appId, String id, String key, ProxyBlock proxy)
Get the list of sandbox of a given application.static String
getSummaryReport(String buildId, String id, String key, ProxyBlock proxy)
Get the summary report of a given build (by ID).static void
setupCredential(com.veracode.apiwrapper.AbstractAPIWrapper wrapper, String id, String key)
Setup the credential of a wrapper.static void
setupProxy(com.veracode.apiwrapper.AbstractAPIWrapper wrapper, ProxyBlock proxyInfo)
Setup proxy settings of a wrapper.
-
-
-
Method Detail
-
setupCredential
public static final void setupCredential(com.veracode.apiwrapper.AbstractAPIWrapper wrapper, String id, String key)
Setup the credential of a wrapper.
-
setupProxy
public static final void setupProxy(com.veracode.apiwrapper.AbstractAPIWrapper wrapper, ProxyBlock proxyInfo)
Setup proxy settings of a wrapper.- Parameters:
wrapper
- aAbstractAPIWrapper
object - the target wrapper to set the proxy settings.proxyInfo
- aProxyBlock
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
- aString
object - the target application.sandboxName
- aString
object - the name of the sandbox being used for this build. It could be null or empty.id
- aString
object - the Veracode API ID.key
- aString
object - the Veracode API key.proxy
- aProxyBlock
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
- aString
object - the target application ID.buildId
- aString
object - the target build ID.id
- aString
object - the Veracode API ID.key
- aString
object - the Veracode API key.proxy
- aProxyBlock
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
- aString
object - the ID of a build.id
- aString
object - the Veracode API ID.key
- aString
object - the Veracode API key.proxy
- aProxyBlock
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
- aString
object - the ID of an application.id
- aString
object - the Veracode API ID.key
- aString
object - the Veracode API key.proxy
- aProxyBlock
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
- aString
object - the ID of a build.id
- aString
object - the Veracode API ID.key
- aString
object - the Veracode API key.proxy
- aProxyBlock
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.
-
-