Package org.gradle.api

Examples of org.gradle.api.InvalidUserDataException


    }

    public File mkdir(Object path) {
        File dir = fileResolver.resolve(path);
        if (dir.isFile()) {
            throw new InvalidUserDataException(String.format("Can't create directory. The path=%s points to an existing file.", path));
        }
        dir.mkdirs();
        return dir;
    }
View Full Code Here


                }
                for (PropertyValue propertyValue : propertyValues) {
                    propertyValue.checkValid();
                }
            } catch (InvalidUserDataException e) {
                throw new InvalidUserDataException(String.format("Error validating %s: %s", task, e.getMessage()), e);
            }
        }
View Full Code Here

        return this;
    }

    public File getDir() {
        if (dir == null) {
            throw new InvalidUserDataException("A base directory must be specified in the task or via a method argument!");
        }
        return resolver.resolve(dir);
    }
View Full Code Here

    }

    @Override
    protected void checkPreconditions(IProjectRegistry<?> registry) {
        if (!buildFile.exists()) {
            throw new InvalidUserDataException(String.format("Build file '%s' does not exist.", buildFile));
        }
        if (!buildFile.isFile()) {
            throw new InvalidUserDataException(String.format("Build file '%s' is not a file.", buildFile));
        }
    }
View Full Code Here

                    if (properties != null) {
                        ConfigureUtil.configureByMap(properties, result);
                    }
                    return result;
                } catch (Throwable th) {
                    throw new InvalidUserDataException("Error - Invalid filter specification for " + filterType.getName());
                }
            }
        });
    }
View Full Code Here

    }

    @Override
    protected void checkPreconditions(IProjectRegistry<?> registry) {
        if (!dir.exists()) {
            throw new InvalidUserDataException(String.format("Project directory '%s' does not exist.", dir));
        }
        if (!dir.isDirectory()) {
            throw new InvalidUserDataException(String.format("Project directory '%s' is not a directory.", dir));
        }
    }
View Full Code Here

        Set<File> existingSourceDirs = new LinkedHashSet<File>();
        for (File srcDir : srcDirs) {
            if (srcDir.isDirectory()) {
                existingSourceDirs.add(srcDir);
            } else if (srcDir.exists()) {
                throw new InvalidUserDataException(String.format("Source directory '%s' is not a directory.", srcDir));
            }
        }
        return existingSourceDirs;
    }
View Full Code Here

     * @param uploadDescriptor
     * @param descriptorDestination
     */
    public PublishInstruction(boolean uploadDescriptor, File descriptorDestination) {
        if (uploadDescriptor && descriptorDestination == null) {
            throw new InvalidUserDataException("You must specify a module descriptor destination, if a module descriptor should be uploaded.");
        }
        if (!uploadDescriptor && descriptorDestination != null) {
            throw new InvalidUserDataException("You must not specify a module descriptor destination, if a module descriptor should not be uploaded.");
        }
        this.uploadDescriptor = uploadDescriptor;
        this.descriptorDestination = descriptorDestination;
    }
View Full Code Here

        return pomFilters.get(name).getFilter();
    }

    public MavenPom pom(String name) {
        if (name == null) {
            throw new InvalidUserDataException("Name must not be null.");
        }
        return pomFilters.get(name).getPomTemplate();
    }
View Full Code Here

    public void validateConfiguration() {
        // check the location of the static content/jsps etc
        try {
            if ((getWebAppSourceDirectory() == null) || !getWebAppSourceDirectory().exists()) {
                throw new InvalidUserDataException("Webapp source directory "
                        + (getWebAppSourceDirectory() == null ? "null" : getWebAppSourceDirectory().getCanonicalPath())
                        + " does not exist");
            } else {
                logger.info("Webapp source directory = " + getWebAppSourceDirectory().getCanonicalPath());
            }
        } catch (IOException e) {
            throw new InvalidUserDataException("Webapp source directory does not exist", e);
        }

        // check reload mechanic
        if (!"automatic".equalsIgnoreCase(reload) && !"manual".equalsIgnoreCase(reload)) {
            throw new InvalidUserDataException("invalid reload mechanic specified, must be 'automatic' or 'manual'");
        } else {
            logger.info("Reload Mechanic: " + reload);
        }

        // get the web.xml file if one has been provided, otherwise assume it is in the webapp src directory
        if (getWebXml() == null) {
            setWebXml(new File(new File(getWebAppSourceDirectory(), "WEB-INF"), "web.xml"));
        }
        logger.info("web.xml file = " + getWebXml());

        //check if a jetty-env.xml location has been provided, if so, it must exist
        if (getJettyEnvXml() != null) {
            setJettyEnvXmlFile(jettyEnvXml);

            try {
                if (!getJettyEnvXmlFile().exists()) {
                    throw new InvalidUserDataException("jetty-env.xml file does not exist at location " + jettyEnvXml);
                } else {
                    logger.info(" jetty-env.xml = " + getJettyEnvXmlFile().getCanonicalPath());
                }
            } catch (IOException e) {
                throw new InvalidUserDataException("jetty-env.xml does not exist");
            }
        }

        setExtraScanTargets(new ArrayList<File>());
        if (scanTargets != null) {
View Full Code Here

TOP

Related Classes of org.gradle.api.InvalidUserDataException

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.