Package org.apache.tools.ant.types

Examples of org.apache.tools.ant.types.ZipFileSet


                log("Problem reading source WAR to when trying to detect "
                    + "already present JAR files (" + ioe + ")",
                    Project.MSG_WARN);
            }
        }
        ZipFileSet jar = new ZipFileSet();
        File file = ResourceUtils.getResourceLocation(resourceName);
        if (file != null)
        {
            jar.setFile(file);
            addLib(jar);
        }
        else
        {
            log("Could not find the " + theDescription + " JAR",
View Full Code Here


        File applicationsDir =
            createDirectory(testDomainDir, "applications");
        Jar jar = (Jar) createAntTask("jar");
        jar.setDestFile(new File(applicationsDir,
            getDeployableFile().getName()));
        ZipFileSet zip = new ZipFileSet();
        zip.setSrc(getDeployableFile());
        jar.addZipfileset(zip);
        FileSet fileSet = new FileSet();
        fileSet.setDir(this.tmpDir);
        fileSet.createInclude().setName("weblogic.xml");
        jar.addFileset(fileSet);
View Full Code Here

                String[] srcFiles = ds.getIncludedFiles();

    String prefix = "";
    String fullpath = "";
    if ( fs instanceof ZipFileSet ) {
        ZipFileSet zfs = (ZipFileSet)fs;
        // Below calls to getPrefix and getFullpath work only
        // on Ant 1.6.2 and higher.
        String tmpPrefix = zfs.getPrefix(getProject());
        String tmpFullpath = zfs.getFullpath(getProject());
        if ( tmpPrefix != null && !tmpPrefix.equals("") ) {
      prefix = tmpPrefix;
        }
        else if ( tmpFullpath != null && !tmpFullpath.equals("") ) {
      // This means the fileset contains a single file
View Full Code Here

   
    public void addConfiguredLib(Lib lib) {
        log("addLib()", Project.MSG_VERBOSE);
        Iterator iter = lib.filesets.iterator();
        while (iter.hasNext()) {
            ZipFileSet fileset = (ZipFileSet)iter.next();
            fileset.setPrefix("lib/");
            super.addFileset(fileset);
        }
    }
View Full Code Here

    public void addConfiguredMainJars(MainJars jars) {
      this.mainJars = jars;
        log("addMainJar()", Project.MSG_VERBOSE);
        Iterator iter = jars.filesets.iterator();
        while (iter.hasNext()) {
            ZipFileSet fileset = (ZipFileSet)iter.next();
            fileset.setPrefix("main/");
            super.addFileset(fileset);
        }
    }
View Full Code Here

   
    public void addConfiguredWrap(Wrap lib) {
        log("addWrap()", Project.MSG_VERBOSE);
        Iterator iter = lib.filesets.iterator();
        while (iter.hasNext()) {
            ZipFileSet fileset = (ZipFileSet)iter.next();
            fileset.setPrefix("wrap/");
            super.addFileset(fileset);
        }
    }
View Full Code Here

   
    public void addConfiguredBinLib(BinLib lib) {
        log("addBinLib()", Project.MSG_VERBOSE);
        Iterator iter = lib.filesets.iterator();
        while (iter.hasNext()) {
            ZipFileSet fileset = (ZipFileSet)iter.next();
            fileset.setPrefix("binlib/");
            super.addFileset(fileset);
        }
    }
View Full Code Here

   
    public void execute() throws BuildException {
        log("execute()", Project.MSG_VERBOSE);
        // First include a main.jar if specified.
        if (main != null && main.jar != null) {
            ZipFileSet fs = new ZipFileSet();
            fs.setProject(getProject());
            fs.setFile(main.jar);
            fs.setPrefix("main/");
            //System.out.println("main.jar fs=" + fs);
            super.addFileset(fs);
        }
       
        // Then, add all files to the final jar.
View Full Code Here

                            + " res.class: " + fres.getClass().getName()
                            + " res.file: " + fres.getFile()
                            , Project.MSG_DEBUG);
                    final File dir = fres.getFile().getParentFile();
                    final String name = fres.getFile().getName();
                    final ZipFileSet fileset = new ZipFileSet();
                    fileset.setProject(getProject());
                    fileset.setDir(dir);
                    fileset.createInclude().setName(name);
                    filesets.add(fileset);
                } else {
                    throw new BuildException("Not a file resource: " + res);
                }
            }         
View Full Code Here

                    }
                }

                if (doUpdate) {
                    addingNewFiles = false;
                    ZipFileSet oldFiles = new ZipFileSet();
                    oldFiles.setProject(getProject());
                    oldFiles.setSrc(renamedFile);
                    oldFiles.setDefaultexcludes(false);

                    for (int i = 0; i < addedFiles.size(); i++) {
                        PatternSet.NameEntry ne = oldFiles.createExclude();
                        ne.setName((String) addedFiles.elementAt(i));
                    }
                    DirectoryScanner ds =
                        oldFiles.getDirectoryScanner(getProject());
                    ((ZipScanner) ds).setEncoding(encoding);

                    String[] f = ds.getIncludedFiles();
                    Resource[] r = new Resource[f.length];
                    for (int i = 0; i < f.length; i++) {
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.ZipFileSet

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.