Package org.apache.tools.ant.taskdefs

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


        }
        return sb.toString();
    }

    private void copySourcesToDest() throws BuildException {
        Copy copy = new Copy();

        copy.setProject(getProject());
        copy.setTodir(m_destdir);
        copy.setOverwrite(false);
        copy.setTaskName("copy");
        copy.setVerbose(m_verbose);

        List sourceDir = getDirectories(m_src);
        for (Iterator iterator = sourceDir.iterator(); iterator.hasNext();) {
            String dir = (String) iterator.next();
            FileSet anonFs = new FileSet();
            anonFs.setIncludes(CLASS_PATTERN);
            if (m_includePattern != null) {
                anonFs.setIncludes(m_includePattern);
            }
            anonFs.setDir(new File(dir));
            copy.addFileset(anonFs);
        }
        copy.execute();
    }
View Full Code Here




    private void copySourcesToDest() throws BuildException {

        Copy copy = new Copy();



        copy.setProject(getProject());

        copy.setTodir(m_destdir);

        copy.setOverwrite(false);

        copy.setTaskName("copy");

        copy.setVerbose(m_verbose);



        List sourceDir = getDirectories(m_src);

        for (Iterator iterator = sourceDir.iterator(); iterator.hasNext();) {

            String dir = (String) iterator.next();

            FileSet anonFs  = new FileSet();

            anonFs.setIncludes(CLASS_PATTERN);

            if (m_includePattern != null) {

                anonFs.setIncludes(m_includePattern);

            }

            anonFs.setDir(new File(dir));

            copy.addFileset(anonFs);

        }

        copy.execute();

    }
View Full Code Here

            }
        }

        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

     */
    private void copyContents(File theSourceDir, File theTargetDir)
    {
        Project antProject = new Project();
        antProject.init();
        Copy copy = new Copy();
        copy.setProject(antProject);
        copy.setTodir(theTargetDir);
        FileSet fileSet = new FileSet();
        fileSet.setDir(theSourceDir);
        copy.addFileset(fileSet);
        copy.execute();
    }
View Full Code Here

     */
    private void copyCactusWebappResources(File theDir) throws CoreException
    {
        Project antProject = new Project();
        antProject.init();
        Copy copy = new Copy();
        copy.setProject(antProject);
        copy.setTodir(theDir);
        CactusPlugin thePlugin = CactusPlugin.getDefault();
        URL jspRedirectorURL = null;
    try {
      jspRedirectorURL = Platform.asLocalURL(thePlugin.getBundle().getEntry(JSPREDIRECTOR_PATH));
    } catch (IOException e1) {
      //do nothing the exception is called later.
    }
        if (jspRedirectorURL == null)
        {
            throw CactusPlugin.createCoreException(
                "CactusLaunch.message.prepare.error.plugin.file",
                " : " + JSPREDIRECTOR_PATH,
                null);
        }
        try{
          jspRedirectorURL = Platform.asLocalURL(jspRedirectorURL);
        } catch(IOException e) {
            throw CactusPlugin.createCoreException(
                    "CactusLaunch.message.prepare.error.plugin.file",
                    " : " + e.getMessage(),
                    null);
        }
        //CactusPlugin.log(jspRedirectorURL.getPath());
        File jspRedirector = new File(jspRedirectorURL.getPath());
        FileSet fileSet = new FileSet();
        fileSet.setFile(jspRedirector);
        copy.addFileset(fileSet);
        copy.execute();
    }
View Full Code Here

     *            The file pattern to match to locate files to copy.
     */
    protected void copyGeneratedObjects(final String inSourceDirectory,
            final String inDestinationDirectory, final String inPattern) {
        antProject = AntUtils.createProject();
        Copy copyTask = (Copy) antProject.createTask("copy");

        FileSet fileSet = AntUtils.createFileset(inSourceDirectory, inPattern,
                new ArrayList());
        log("Installing generated files (pattern: " + inPattern + ")...");
        copyTask.setTodir(new File(inDestinationDirectory));
        copyTask.addFileset(fileSet);
        copyTask.execute();
    }
View Full Code Here

                    + "/src/main/resources/sqlmaps");
            if (sqlMapsDir.exists()) {
                sqlMapsDir.mkdir();
            }

            Copy copy = (Copy) antProject.createTask("copy");
            copy.setFile(new File(sourceDirectory
                    + "/src/main/resources/sqlmaps/" + pojoName + "SQL.xml"));
            copy.setTodir(new File(destinationDirectory
                    + "/src/main/resources/sqlmaps"));
            copy.execute();
        }
    }
View Full Code Here

    }

    // =================== Views ===================

    private void installJSFViews() {
        Copy copy = (Copy) antProject.createTask("copy");
        copy.setFile(new File(sourceDirectory + "/src/main/webapp/pages/"
                + pojoName + "/form.xhtml"));
        copy.setTofile(new File(destinationDirectory
                + "/src/main/webapp/pages/" + pojoNameLower + "/form.xhtml"));
        copy.execute();

        log("Added JSF-view /src/main/webapp/pages/" + pojoNameLower
                + "/form.xhtml");

        copy.setFile(new File(sourceDirectory + "/src/main/webapp/pages/"
                + pojoName + "/list.xhtml"));
        copy.setTofile(new File(destinationDirectory
                + "/src/main/webapp/pages/" + pojoNameLower + "/list.xhtml"));
        copy.execute();

        log("Added JSF-view /src/main/webapp/pages/" + pojoNameLower
                + "/list.xhtml");
    }
View Full Code Here

        log("Added JSF-view /src/main/webapp/pages/" + pojoNameLower
                + "/list.xhtml");
    }

    private void installSpringViews() {
        Copy copy = (Copy) antProject.createTask("copy");
        copy.setFile(new File(sourceDirectory
                + "/src/main/webapp/WEB-INF/pages/" + pojoName + "form.jsp"));
        copy.setTofile(new File(destinationDirectory
                + "/src/main/webapp/WEB-INF/pages/" + pojoNameLower
                + "form.jsp"));
        copy.execute();

        copy.setFile(new File(sourceDirectory
                + "/src/main/webapp/WEB-INF/pages/" + pojoName + "s.jsp"));
        copy.setTofile(new File(destinationDirectory
                + "/src/main/webapp/WEB-INF/pages/" + pojoNameLower + "s.jsp"));
        copy.execute();
    }
View Full Code Here

                + "/src/main/webapp/WEB-INF/pages/" + pojoNameLower + "s.jsp"));
        copy.execute();
    }

    private void installStrutsViews() {
        Copy copy = (Copy) antProject.createTask("copy");
        copy.setFile(new File(sourceDirectory
                + "/src/main/webapp/WEB-INF/pages/" + pojoName + "Form.jsp"));
        copy.setTofile(new File(destinationDirectory
                + "/src/main/webapp/WEB-INF/pages/" + pojoNameLower
                + "Form.jsp"));
        copy.execute();

        copy.setFile(new File(sourceDirectory
                + "/src/main/webapp/WEB-INF/pages/" + pojoName + "List.jsp"));
        copy.setTofile(new File(destinationDirectory
                + "/src/main/webapp/WEB-INF/pages/" + pojoNameLower
                + "List.jsp"));
        copy.execute();
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.Copy

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.