Package org.apache.tools.ant.types

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


                DirectoryScanner ds = fs.getDirectoryScanner();
                // the previous line has already scanned the
                // filesystem, in order to avoid a rescan when later
                // iterating, capture the results now and store them
                final String[] files = ds.getIncludedFiles();
                resourcesToDelete.add(new ResourceCollection() {
                        public boolean isFilesystemOnly() {
                            return true;
                        }
                        public int size() {
                            return files.length;
View Full Code Here


        validate();
        if (binary && dest == null) {
            throw new BuildException(
                "dest|destfile attribute is required for binary concatenation");
        }
        ResourceCollection c = getResources();
        if (isUpToDate(c)) {
            log(dest + " is up-to-date.", Project.MSG_VERBOSE);
            return;
        }
        if (c.size() == 0 && ignoreEmpty) {
            return;
        }
        try {
            //most of these are defaulted because the concat-as-a-resource code hijacks a lot:
            ResourceUtils.copyResource(new ConcatResource(c), dest == null
View Full Code Here

            // case-insensitive.
            String fromDirSep = onWindows ? "\\" : "/";

            StringBuffer rslt = new StringBuffer();

            ResourceCollection resources = isPreserveDuplicates() ? (ResourceCollection) path : new Union(path);
            List ret = new ArrayList();
            FileNameMapper mapperImpl = mapper == null ? new IdentityMapper() : mapper.getImplementation();
            for (Resource r : resources) {
                String[] mapped = mapperImpl.mapFileName(String.valueOf(r));
                for (int m = 0; mapped != null && m < mapped.length; ++m) {
View Full Code Here

        throws IOException {

        List/*<ResourceWithFlags>*/ l = new ArrayList/*<ResourceWithFlags>*/();
        Set/*<String>*/ addedNames = new HashSet/*<String>*/();
        for (Iterator rcs = sources.iterator(); rcs.hasNext(); ) {
            ResourceCollection rc = (ResourceCollection) rcs.next();
            ResourceCollectionFlags rcFlags = getFlags(rc);
            for (Iterator rs = rc.iterator(); rs.hasNext(); ) {
                Resource r = (Resource) rs.next();
                if (!isFilesOnly() || !r.isDirectory()) {
                    ResourceWithFlags rwf =
                        new ResourceWithFlags(r, rcFlags, getFlags(r));
                    String name = rwf.getName();
View Full Code Here

       
        if (getResources() == null) {
            return;
        }
       
        ResourceCollection rc = getResources();
        Iterator i = rc.iterator();
        ArrayList<File> files = new ArrayList<File>();
       
        try {
            while (i.hasNext()) {
                files.add(((FileResource) i.next()).getFile());
View Full Code Here

            return;
        }
       
        try {
            ArrayList<File> files = new ArrayList<File>();
            ResourceCollection rc = getResources();
            Iterator i = rc.iterator();
           
            while (i.hasNext()) {
                files.add(((FileResource) i.next()).getFile());
            }
           
View Full Code Here

        StringBuffer sb = new StringBuffer();
       
        //sb.append("-jar ");
        //sb.append(m_closureJar.getAbsolutePath() + " ");
       
        ResourceCollection c = getResources();
        Iterator i = c.iterator();

        long lastMod = -1;

        while (i.hasNext()) {
            lastMod = Math.max(lastMod, ((FileResource) i.next()).getLastModified());
        }

        sb.append("--js_output_file ");
        sb.append(m_destinationFile.getAbsolutePath() + " ");

        if (m_destinationFile.lastModified() >= lastMod) {
            /*
             * If the generated file is newer than the source
             * files then there is no need to rebuild.
             */
            return;
        }

        i = c.iterator();
        while (i.hasNext()) {
            sb.append("--js ");
            sb.append(i.next() + " ");
        }
       
View Full Code Here

            FileSet fs = (FileSet) getImplicitFileSet().clone();
            fs.setDir(baseDir);
            vfss.addElement(fs);
        }
        for (int i = 0; i < resources.size(); i++) {
            ResourceCollection rc = (ResourceCollection) resources.elementAt(i);
            vfss.addElement(rc);
        }

        ResourceCollection[] fss = new ResourceCollection[vfss.size()];
        vfss.copyInto(fss);
View Full Code Here

            ResourceUtils.selectOutOfDateSources(this, rs, mapper,
                                                 getZipScanner());
        if (!doFilesonly) {
            Union u = new Union();
            u.addAll(Arrays.asList(selectDirectoryResources(initial)));
            ResourceCollection rc =
                ResourceUtils.selectSources(this, u, mapper,
                                            getZipScanner(),
                                            MISSING_DIR_PROVIDER);
            if (rc.size() > 0) {
                ArrayList newer = new ArrayList();
                newer.addAll(Arrays.asList(((Union) rc).listResources()));
                newer.addAll(Arrays.asList(result));
                result = (Resource[]) newer.toArray(result);
            }
View Full Code Here

        validate();
        if (binary && dest == null) {
            throw new BuildException(
                "dest|destfile attribute is required for binary concatenation");
        }
        ResourceCollection c = getResources();
        if (isUpToDate(c)) {
            log(dest + " is up-to-date.", Project.MSG_VERBOSE);
            return;
        }
        if (c.size() == 0 && ignoreEmpty) {
            return;
        }
        try {
            //most of these are defaulted because the concat-as-a-resource code hijacks a lot:
            ResourceUtils.copyResource(new ConcatResource(c), dest == null ? new LogOutputResource(
View Full Code Here

TOP

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

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.