public void execute()

in src/main/java/org/apache/easyant/tasks/PathTask.java [52:84]


    public void execute() throws BuildException {
        if (pathid == null) {
            throw new BuildException("pathid is mandatory");
        }
        Object element = getProject().getReference(pathid);
        if (element == null) {
            if (OVERWRITE_PREPEND.equals(overwrite) || OVERWRITE_APPEND.equals(overwrite)) {
                throw new BuildException("destination path not found: " + pathid);
            }
            getProject().addReference(pathid, path);
        } else {
            if (OVERWRITE_FALSE.equals(overwrite)) {
                return;
            }
            if (!(element instanceof Path)) {
                throw new BuildException("destination path is not a path: " + element.getClass());
            }
            if (OVERWRITE_TRUE.equals(overwrite)) {
                getProject().addReference(pathid, path);
            } else {
                Path dest = (Path) element;
                if (OVERWRITE_PREPEND.equals(overwrite)) {
                    // no way to add path elements at te beginning of the
                    // existing path: we do the opposite
                    // and replace the reference
                    path.append(dest);
                    getProject().addReference(pathid, path);
                } else { // OVERWRITE_APPEND
                    dest.append(path);
                }
            }
        }
    }