|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.web.project.ant; import java.io.File; import java.io.IOException; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.PathTokenizer; import org.apache.tools.ant.Task; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Copy; /** * Ant task that copies multiple files specified by one property (separated by ';'). * It merely delegates to copy task for every file in the files attribute. * The files attribute is parsed as a Path structure. * * This is a workaround for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18128. * * @author Pavel Buzek */ public class CopyFiles extends Task { private File todir; private String files; public void execute() throws BuildException { PathTokenizer tokenizer = new PathTokenizer (getFiles ()); while (tokenizer.hasMoreTokens ()) { File f = getProject().resolveFile(tokenizer.nextToken()); Copy cp = (Copy) getProject ().createTask ("copy"); cp.setTodir (getToDir ()); cp.setFile (f); cp.execute (); } } public String getFiles() { return this.files; } public void setFiles (String files) { this.files = files; } public File getToDir() { return this.todir; } public void setToDir (File todir) { this.todir = todir; } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.