Class RemoteScanUtil


  • public final class RemoteScanUtil
    extends Object
    The RemoteScanUtil is a utility class related to perfoming the scans in remote location.
    • Constructor Detail

      • RemoteScanUtil

        public RemoteScanUtil()
    • 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 - a String object.
        Returns:
        a int.
      • getMaskPosition

        public static Integer[] getMaskPosition​(List<String> remoteCmd)
        Masks the sensitive data.
        Parameters:
        remoteCmd - a List object.
        Returns:
        an array of Integer objects.
      • getPathSeparator

        public static String getPathSeparator​(String remote)
        Returns the path separator for Windows or Linux.
        Parameters:
        remote - a String object.
        Returns:
        a String object.
      • getRemoteVeracodePath

        public static FilePath getRemoteVeracodePath​(AbstractBuild<?,​?> build)
        Returns the remote file path where Veracode API Wrapper is copied.
        Parameters:
        build - a AbstractBuild object.
        Returns:
        a FilePath object.
      • getRemoteVeracodePath

        public static FilePath getRemoteVeracodePath​(Node node)
        Returns the remote file path where Veracode API Wrapper is copied.
        Parameters:
        node - a Node object.
        Returns:
        a FilePath object.
      • formatParameterValue

        public static String formatParameterValue​(String parameterValue)
        Returns edited parameter values to avoid splitting if they contain spaces in pipeline with remote scan.
        Parameters:
        parameterValue - a String object.
        Returns:
        a String object.
      • 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 - a String object.
        arguments - a String array.
        isUnix - a boolean.
        Returns:
        a ArgumentListBuilder object.