public static void validateProjectName()

in src/main/java/com/amazonaws/codepipeline/jenkinsplugin/Validation.java [38:57]


    public static void validateProjectName(
            final String projectName,
            final TaskListener listener) throws IllegalArgumentException {

        if (projectName.length() > MAX_PROJECT_NAME_LENGTH) {
            final String error = "Invalid project name: " + projectName + ". The AWS CodePipeline Jenkins plugin supports project names with a maximum of " + MAX_PROJECT_NAME_LENGTH + " characters.";
            LoggingHelper.log(listener, error);
            throw new IllegalArgumentException(error);
        }

        for (final Character c : projectName.toCharArray()) {
            if (!Character.isLetterOrDigit(c) && c != '_' && c != '-') {
                final String error = "Invalid project name: " + projectName + ". The AWS CodePipeline Jenkins plugin supports project names with alphanumeric characters and the special " +
                        "characters - (minus sign) and _ (underscore).";
                LoggingHelper.log(listener, error);

                throw new IllegalArgumentException(error);
            }
        }
    }