agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobRequestInputProcessor.java
/**
     * Processes a single value provided for a {@link SoftwareInput} field in a
     * job request.
     * @param softwareInput the software input for which we are parsing the value
     * @param value a single input string value
     * @return the sanitized json array of input values
     * @throws PermissionException if the user does not have permission to access the input
     */
Processes a single value provided for a  SoftwareInput field in a
job request.
@param softwareInput the software input for which we are parsing the value
@param value a single input string value
@return the sanitized json array of input values
@throws PermissionException if the user does not have permission to access the input
Processes a single value provided for a SoftwareInput field in a job request . @param softwareInput the software input for which we are parsing the value @param value a single input string value @return the sanitized json array of input values @throws PermissionException if the user does not have permission to access the input
protected ArrayNode doProcessSoftwareInputValue(SoftwareInput softwareInput, String value)
            throws PermissionException, JobProcessingException {
        ArrayNode jobRequestInputValue = getMapper().createArrayNode();
        if (StringUtils.isNotBlank(value)) {
            String[] explodedInputs = null;
            if (value.contains(Settings.AGAVE_SERIALIZED_LIST_DELIMITER)) {
                explodedInputs = StringUtils.splitByWholeSeparatorPreserveAllTokens(value, Settings.AGAVE_SERIALIZED_LIST_DELIMITER);
            } else {
                explodedInputs = StringUtils.splitByWholeSeparatorPreserveAllTokens(value, ";");
            }
            for (String singleInput : explodedInputs) {
                String singleStrippedInput = StringUtils.stripToNull(singleInput);
                if (singleStrippedInput != null) {
                    jobRequestInputValue.add(singleStrippedInput);
                }
            }
        }
        return doProcessSoftwareInputValue(softwareInput, jobRequestInputValue);
    }
protected ArrayNode doProcessSoftwareInputValue ( SoftwareInput softwareInput , String value ) throws PermissionException , JobProcessingException { ArrayNode jobRequestInputValue = getMapper ( ) . createArrayNode ( ) ; if ( StringUtils . isNotBlank ( value ) ) { String [ ] explodedInputs = null ; if ( value . contains ( Settings . AGAVE_SERIALIZED_LIST_DELIMITER ) ) { explodedInputs = StringUtils . splitByWholeSeparatorPreserveAllTokens ( value , Settings . AGAVE_SERIALIZED_LIST_DELIMITER ) ; } else { explodedInputs = StringUtils . splitByWholeSeparatorPreserveAllTokens ( value , ";" ) ; } for ( String singleInput : explodedInputs ) { String singleStrippedInput = StringUtils . stripToNull ( singleInput ) ; if ( singleStrippedInput != null ) { jobRequestInputValue . add ( singleStrippedInput ) ; } } } return doProcessSoftwareInputValue ( softwareInput , jobRequestInputValue ) ; }
Processes a single value provided for a {@link SoftwareInput} field in a
 job request.
Processes a single value provided for a { @link SoftwareInput } field in a job request .
// blank values would be ignored when splitting, so we check for them first and preserve them // as a single empty array // If the job is submitted via a form and the input is provided via a single, semicolon // separated list, then the actual parameter values cannot contain a semicolon, which is // undesirable given that the wrapper scripts are run as shell scripts and the parameter // value may legitimately need to include a semicolon. // We can't solve this in every situation, so we work around it when we can, which is when // the job request is made via JSON. In that case, each value of the parameter's JSON array // is parsed, replacing all instances of a semicolon with a random 128 character, base64 // encoded delimiter generated when the server starts up. Here, we search for the delimiter // and, if found, split the concatenated input values on that value, thereby allowing for // the preservation of semicolons in the user's original parameter value. // Unfortunately, we cannot reliably do this for single value form requests, so in those // situations, we preserve the original value and fall back to the documented behavior of // splitting on semicolon. // now process the list of inputs for valid values