Package org.jitterbit.util.name

Examples of org.jitterbit.util.name.IllegalNameException


     *
     */
    @Override
    public void validateName(String name) throws IllegalNameException {
        if (name == null || name.trim().length() == 0) {
            throw new IllegalNameException("The name cannot be empty.");
        }
        if (name.length() > MAX_LENGTH) {
            throw new IllegalNameException("The name cannot be longer than " + MAX_LENGTH + " characters.");
        }
    }
View Full Code Here


        return sb.toString();
    }

    private static void doDotValidation(String name) {
        if (name.endsWith(".")) {
            throw new IllegalNameException("The project name cannot end with '.'");
        }
    }
View Full Code Here

        }
    }

    private static void doSpaceValidation(String name) {
        if (name.contains("  ")) {
            throw new IllegalNameException("The project name cannot contain consecutive spaces.");
        }
    }
View Full Code Here

   
    @Override
    public void validateName(String name) throws IllegalNameException {
        defaultValidator.validateName(name);
        if (name.toLowerCase().startsWith("jitterbit connect")) {
            throw new IllegalNameException("\"Jitterbit Connect\" is a reserved folder name.");
        }
    }
View Full Code Here

    }
   
    @Override
    public void validate(String filename) throws IllegalNameException {
        if ((filename == null) || (filename.length() == 0)) {
            throw new IllegalNameException("The name cannot be empty.");
        }
        if (containsIllegalCharacter(filename)) {
            throw new IllegalNameException(null, filename, illegalCharacters.toString());
        }
        if (endsWithSeparator(filename)) {
            throw new IllegalNameException("The file name may not end with the character '"
                    + filename.charAt(filename.length() - 1) + "'.", filename);
        }
    }
View Full Code Here

    }

    @Override
    public void validate(String filename) throws IllegalNameException {
        if (StringUtils.isBlank(filename)) {
            throw new IllegalNameException("The name cannot be empty");
        }
        checkIllegalChars(filename);
        checkReservedNames(filename);
    }
View Full Code Here

    }

    private void checkIllegalChars(String name) throws IllegalNameException {
        if (hasIllegalChars(name)) {
            String message = MessageFormat.format(illegalCharsPattern, getIllegalCharsString());
            throw new IllegalNameException(message);
        }
    }
View Full Code Here

        }
    }

    private void checkReservedNames(String name) throws IllegalNameException {
        if (isReservedWord(name)) {
            throw new IllegalNameException(reservedNameMessage);
        }
    }
View Full Code Here

                DEFAULT_VALIDATOR.validateName(name);
            }
            for (IntegrationEntity entity : owner.getAllChildren()) {
                if (entity instanceof TextDocument) {
                    if (((TextDocument) entity).getName().equals(name)) {
                        throw new IllegalNameException("The name '" + name + "' is already in use.");
                    }
                }
            }
        }
View Full Code Here

        if (name == null) {
            name = "";
        }
        name = name.trim();
        if (!EntityUtils.isNameUnique(this, name)) {
            throw new IllegalNameException("The name \"" + name + "\" is already in use.");
        }
        super.setName(name);
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.util.name.IllegalNameException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.