Examples of Copy


Examples of org.apache.tools.ant.taskdefs.Copy

            }
        }

        if (!this.confFileSets.isEmpty())
        {
            Copy copy = (Copy) createAntTask("copy");
            copy.setTodir(theConfDir);
            for (Iterator i = this.confFileSets.iterator(); i.hasNext();)
            {
                copy.addFileset((FileSet) i.next());
            }
            copy.execute();
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Copy

    }
  }

    protected static void copySingleFile(File sourceFile, File destFile) {
        Project p = new Project();
        Copy c = new Copy();
        c.setProject(p);
        c.setTofile(destFile);
        FileSet fs = new FileSet();
        fs.setFile(sourceFile);
        c.addFileset(fs);
        c.execute();
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Copy

        c.execute();
    }
   
    protected static void copyDirectory(File source, File dest) {
        Project p = new Project();
        Copy c = new Copy();
        c.setProject(p);
        c.setTodir(dest);
        FileSet fs = new FileSet();
        fs.setDir(source);
        c.addFileset(fs);
        c.execute();
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Copy

     */
    protected static boolean copyDirectory(File source, String suffix, File dest) {
      boolean result = false;
      try {
        Project p = new Project();
        Copy c = new Copy();
        c.setProject(p);
        c.setTodir(dest);
        FileSet fs = new FileSet();
        fs.setDir(source);
        if (null != suffix) {
          fs.setIncludes("*" + suffix); // add the wildcard.
        }
        c.addFileset(fs);
        c.execute();
       
        // handle case where no files match; must create empty directory.
        if (!dest.exists()) {
          result = dest.mkdirs();
        } else {
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Copy

    if(syncPath.endsWith(Constants.JAR_FILE_EXTENSION_NAME)){
      File syncFolder=new File(catalinaPath,syncPath.substring(0,syncPath.lastIndexOf("/")));
      Console.println("Bublish Sync Project "+resource.getName()+" To : "+syncFolder);
      if(syncFolder.exists()){
        Project prj=new Project();
        Copy copy=new Copy();
        copy.setOverwrite(true);
        copy.setProject(prj);
        copy.setTodir(syncFolder);
        copy.setFile(new File(bundelName));
        copy.execute();
      }
    }
    return bundelName;
  }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Copy

   */
  public String deployBundelFile(IProject resource){
    Project project=new Project();
    project.setName(resource.getName());
    project.setBasedir(resource.getLocation().toString());
    Copy copy=new Copy();
    copy.setOverwrite(true);
    copy.setProject(project);
    Manifest manifest = getManifest(resource);
    String bundelName=genarateFullName(manifest).toString();
    File bundelFile=new File(bundelName);
    if(!bundelFile.exists()){
      bundelFile.mkdirs();
    }
    Console.println("Bublish Project "+resource.getName()+" As Bundel To : "+bundelFile);
    copy.setTodir(bundelFile);
    //FileSet
    FileSet fileSet=getFileSet(project,resource);
    fileSet.setDir(project.getBaseDir());
    copy.addFileset(fileSet);
    //class
    FileSet classSet=new FileSet();
    String outPut=BuiderParameter.getProjectOutput(resource);
    File baseDir=new File(project.getBaseDir(),outPut);
    //���Ƶ�����Ŀ¼
    classSet.setDir(baseDir);
    classSet.setIncludes("**/*.*");
    copy.addFileset(classSet);
    copy.execute();
    return bundelName;
  }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Copy

   * @param sourceFile2
   * @param realFile
   */
  private void fileCopy(String resource, String destination) {
    Project prj = new Project();
    Copy copy = new Copy();
    copy.setProject(prj);
    copy.setFile(new File(resource));
    File destDir = new File(destination).getParentFile();
    copy.setTodir(destDir);
    copy.execute();
  }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Copy

   * @param resource
   * @param destination
   */
  private void copyDirectory(String resource, String destination) {
    Project prj = new Project();
    Copy copy = new Copy();
    copy.setProject(prj);
    String[] source = resource.split("@");
    copy.setOverwrite(true);
    copy.setTodir(new File(destination));
    // FileSet
    if (source.length > 1) {
      FileSet fileSet = new FileSet();
      fileSet.setDir(new File(source[0]));
      fileSet.setIncludes(source[1]);
      copy.addFileset(fileSet);
    }
    copy.execute();
  }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Copy

  }
    }

    public static void copy(List<File> files, File destDir) throws IOException {
  try {
      Copy task = new Copy();
      task.setProject(new Project());
      task.setTodir(destDir);
      for (File file : files) {
    FileSet fileSet = new FileSet();
    if (file.isDirectory()) {
        fileSet.setDir(file.getParentFile());
        fileSet.setIncludes(file.getName() + "/**");
    } else {
        fileSet.setFile(file);
    }
    task.addFileset(fileSet);
      }
      task.execute();
  } catch (BuildException e) {
      throw new IOException(e);
  }
    }
View Full Code Here

Examples of org.apache.xindice.webadmin.webdav.components.Copy

public class CopyTest extends MethodSetup {

    public void setUp() throws Exception {
        super.setUp();
        method = new Copy();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.