Class RemoteScanUtil
- java.lang.Object
-
- com.veracode.jenkins.plugin.utils.RemoteScanUtil
-
public final class RemoteScanUtil extends Object
The RemoteScanUtil is a utility class related to perfoming the scans in remote location.
-
-
Constructor Summary
Constructors Constructor Description RemoteScanUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ArgumentListBuilder
addArgumentsToCommand(String jarFilePath, String[] arguments, boolean isUnix)
Construct OS specific command using the provided arguments and mask sensitive data.static String
formatParameterValue(String parameterValue)
Returns edited parameter values to avoid splitting if they contain spaces in pipeline with remote scan.static int
getJarVersion(String jarName)
Returns the Veracode API Wrapper jar version in order to decide whether to copy the latest.static Integer[]
getMaskPosition(List<String> remoteCmd)
Masks the sensitive data.static String
getPathSeparator(String remote)
Returns the path separator for Windows or Linux.static FilePath
getRemoteVeracodePath(AbstractBuild<?,?> build)
Returns the remote file path where Veracode API Wrapper is copied.static FilePath
getRemoteVeracodePath(Node node)
Returns the remote file path where Veracode API Wrapper is copied.
-
-
-
Method Detail
-
getJarVersion
public static int getJarVersion(String jarName)
Returns the Veracode API Wrapper jar version in order to decide whether to copy the latest.- Parameters:
jarName
- aString
object.- Returns:
- a int.
-
getMaskPosition
public static Integer[] getMaskPosition(List<String> remoteCmd)
Masks the sensitive data.
-
getPathSeparator
public static String getPathSeparator(String remote)
Returns the path separator for Windows or Linux.
-
getRemoteVeracodePath
public static FilePath getRemoteVeracodePath(AbstractBuild<?,?> build)
Returns the remote file path where Veracode API Wrapper is copied.- Parameters:
build
- aAbstractBuild
object.- Returns:
- a
FilePath
object.
-
getRemoteVeracodePath
public static FilePath getRemoteVeracodePath(Node node)
Returns the remote file path where Veracode API Wrapper is copied.
-
formatParameterValue
public static String formatParameterValue(String parameterValue)
Returns edited parameter values to avoid splitting if they contain spaces in pipeline with remote scan.
-
addArgumentsToCommand
public static ArgumentListBuilder addArgumentsToCommand(String jarFilePath, String[] arguments, boolean isUnix)
Construct OS specific command using the provided arguments and mask sensitive data. Also escapes the quotes for non-Unix OS.- Parameters:
jarFilePath
- aString
object.arguments
- aString
array.isUnix
- a boolean.- Returns:
- a
ArgumentListBuilder
object.
-
-