private void validate()

in src/main/org/apache/ant/compress/taskdefs/PackBase.java [156:184]


    private void validate() throws BuildException {
        if (src == null && srcArchiveTask == null && srcPackTask == null) {
            throw new BuildException("source is required.",
                                     getLocation());
        }

        if (src !=  null) {
            if (src.isDirectory()) {
                throw new BuildException("source resource must not "
                                         + "represent a directory!",
                                         getLocation());
            }

            if (!src.isExists()) {
                throw new BuildException("source resource must exist.");
            }
        }

        if (dest == null) {
            throw new BuildException("dest resource is required.",
                                     getLocation());
        }

        if (dest.isDirectory()) {
            throw new BuildException("dest resource must not "
                                     + "represent a directory!", getLocation());
        }

    }