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 StringgetBuildInfo(String appName, String sandboxName, String id, String key, ProxyBlock proxy)Get the latest build info of an application.static StringgetBuildInfoByAppIdBuildId(String appId, String buildId, String id, String key, ProxyBlock proxy)Get the build information for a given build id.static StringgetDetailedReport(String buildId, String id, String key, ProxyBlock proxy)Get the detailed report of a given build (by ID).static StringgetSandboxList(String appId, String id, String key, ProxyBlock proxy)Get the list of sandbox of a given application.static StringgetSummaryReport(String buildId, String id, String key, ProxyBlock proxy)Get the summary report of a given build (by ID).static voidsetupCredential(com.veracode.apiwrapper.AbstractAPIWrapper wrapper, String id, String key)Setup the credential of a wrapper.static voidsetupProxy(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- aAbstractAPIWrapperobject - the target wrapper to set the proxy settings.proxyInfo- aProxyBlockobject - 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- aStringobject - the target application.sandboxName- aStringobject - the name of the sandbox being used for this build. It could be null or empty.id- aStringobject - the Veracode API ID.key- aStringobject - the Veracode API key.proxy- aProxyBlockobject - the proxy settings. Use null if no proxy is required.- Returns:
- a
Stringobject - 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- aStringobject - the target application ID.buildId- aStringobject - the target build ID.id- aStringobject - the Veracode API ID.key- aStringobject - the Veracode API key.proxy- aProxyBlockobject - the proxy settings. Use null if no proxy is required.- Returns:
- a
Stringobject - 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- aStringobject - the ID of a build.id- aStringobject - the Veracode API ID.key- aStringobject - the Veracode API key.proxy- aProxyBlockobject - the proxy settings. Use null if no proxy is required.- Returns:
- a
Stringobject - 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- aStringobject - the ID of an application.id- aStringobject - the Veracode API ID.key- aStringobject - the Veracode API key.proxy- aProxyBlockobject - the proxy settings. Use null if no proxy is required.- Returns:
- a
Stringobject - 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- aStringobject - the ID of a build.id- aStringobject - the Veracode API ID.key- aStringobject - the Veracode API key.proxy- aProxyBlockobject - the proxy settings. Use null if no proxy is required.- Returns:
- a
Stringobject - the summary report in XML. - Throws:
Exception- when an error is encountered during the process.
-
-