Package org.apache.tools.ant.types

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


        try {
            Vector fileNames = new Vector();
            Vector baseDirs = new Vector();
            for (int i = 0; i < filesets.size(); i++) {
                String currentType = type;
                AbstractFileSet fs = (AbstractFileSet) filesets.elementAt(i);
                if (fs instanceof DirSet) {
                    if (!FileDirBoth.DIR.equals(type)) {
                        log("Found a nested dirset but type is " + type + ". "
                            + "Temporarily switching to type=\"dir\" on the"
                            + " assumption that you really did mean"
                            + " <dirset> not <fileset>.", Project.MSG_DEBUG);
                        currentType = FileDirBoth.DIR;
                    }
                }
                File base = fs.getDir(getProject());

                DirectoryScanner ds = fs.getDirectoryScanner(getProject());

                if (!FileDirBoth.DIR.equals(currentType)) {
                    String[] s = getFiles(base, ds);
                    for (int j = 0; j < s.length; j++) {
                        totalFiles++;
View Full Code Here


     * Get the encoding used for this ZipFileSet.
     * @return String encoding.
     */
    public String getEncoding() {
        if (isReference()) {
            AbstractFileSet ref = getRef(getProject());
            if (ref instanceof ZipFileSet) {
                return ((ZipFileSet) ref).getEncoding();
            } else {
                return null;
            }
View Full Code Here

     * @return String encoding.
     * @since Compress Antlib 1.2
     */
    public String getEncoding() {
        if (isReference()) {
            AbstractFileSet ref = getRef(getProject());
            if (ref instanceof TarFileSet) {
                return ((TarFileSet) ref).getEncoding();
            } else {
                return null;
            }
View Full Code Here

            Vector fileNames = new Vector();
            Vector baseDirs = new Vector();
            for (int i = 0; i < filesets.size(); i++) {
                String currentType = type;
                AbstractFileSet fs = (AbstractFileSet) filesets.elementAt(i);
                if (fs instanceof DirSet) {
                    if (!"dir".equals(type)) {
                        log("Found a nested dirset but type is " + type + ". "
                            + "Temporarily switching to type=\"dir\" on the"
                            + " assumption that you really did mean"
                            + " <dirset> not <fileset>.", Project.MSG_DEBUG);
                        currentType = "dir";
                    }
                }
                File base = fs.getDir(getProject());
                DirectoryScanner ds = fs.getDirectoryScanner(getProject());

                if (!"dir".equals(currentType)) {
                    String[] s = getFiles(base, ds);
                    for (int j = 0; j < s.length; j++) {
                        totalFiles++;
View Full Code Here

        try {
            Vector fileNames = new Vector();
            Vector baseDirs = new Vector();
            for (int i = 0; i < filesets.size(); i++) {
                String currentType = type;
                AbstractFileSet fs = (AbstractFileSet) filesets.elementAt(i);
                if (fs instanceof DirSet) {
                    if (!FileDirBoth.DIR.equals(type)) {
                        log("Found a nested dirset but type is " + type + ". "
                            + "Temporarily switching to type=\"dir\" on the"
                            + " assumption that you really did mean"
                            + " <dirset> not <fileset>.", Project.MSG_DEBUG);
                        currentType = FileDirBoth.DIR;
                    }
                }
                File base = fs.getDir(getProject());

                DirectoryScanner ds = fs.getDirectoryScanner(getProject());

                if (!FileDirBoth.DIR.equals(currentType)) {
                    String[] s = getFiles(base, ds);
                    for (int j = 0; j < s.length; j++) {
                        totalFiles++;
View Full Code Here

            Vector<String> fileNames = new Vector<String>();
            Vector<File> baseDirs = new Vector<File>();
            final int size = filesets.size();
            for (int i = 0; i < size; i++) {
                String currentType = type;
                AbstractFileSet fs = filesets.elementAt(i);
                if (fs instanceof DirSet) {
                    if (!FileDirBoth.DIR.equals(type)) {
                        log("Found a nested dirset but type is " + type + ". "
                            + "Temporarily switching to type=\"dir\" on the"
                            + " assumption that you really did mean"
                            + " <dirset> not <fileset>.", Project.MSG_DEBUG);
                        currentType = FileDirBoth.DIR;
                    }
                }
                File base = fs.getDir(getProject());

                DirectoryScanner ds = fs.getDirectoryScanner(getProject());

                if (!FileDirBoth.DIR.equals(currentType)) {
                    String[] s = getFiles(base, ds);
                    for (int j = 0; j < s.length; j++) {
                        totalFiles++;
View Full Code Here

     * Get the encoding used for this ZipFileSet.
     * @return String encoding.
     */
    public String getEncoding() {
        if (isReference()) {
            AbstractFileSet ref = getRef(getProject());
            if (ref instanceof ZipFileSet) {
                return ((ZipFileSet) ref).getEncoding();
            } else {
                return null;
            }
View Full Code Here

            // access fileset from refid
            if (!(refId.getReferencedObject(getProject()) instanceof AbstractFileSet))
            {
                throw new BuildException(name + " attribute must reference a fileset", getLocation());
            }
            AbstractFileSet fileSet = (AbstractFileSet)refId.getReferencedObject(getProject());
            DirectoryScanner directoryScanner = fileSet.getDirectoryScanner(getProject());
            String [] files = directoryScanner.getIncludedFiles();
            if ((files != null) && (files.length > 0))
            {
                String basePath = canonicalPath(baseDir);
                for (int i = 0; (i < files.length); i++)
                {
                    // convert file relative to fileset to file relative
                    // to archetype base dir
                    String archetypePath = files[i];
                    if (basePath != null)
                    {
                        File file = new File(fileSet.getDir(getProject()), files[i]);
                        String filePath = canonicalPath(file);
                        if ((filePath != null) && filePath.startsWith(basePath))
                        {
                            // path relative to baseDir
                            archetypePath = filePath.substring(basePath.length());
View Full Code Here

        try {
            Vector fileNames = new Vector();
            Vector baseDirs = new Vector();
            for (int i = 0; i < filesets.size(); i++) {
                String currentType = type;
                AbstractFileSet fs = (AbstractFileSet) filesets.elementAt(i);
                if (fs instanceof DirSet) {
                    if (!FileDirBoth.DIR.equals(type)) {
                        log("Found a nested dirset but type is " + type + ". "
                            + "Temporarily switching to type=\"dir\" on the"
                            + " assumption that you really did mean"
                            + " <dirset> not <fileset>.", Project.MSG_DEBUG);
                        currentType = FileDirBoth.DIR;
                    }
                }
                File base = fs.getDir(getProject());

                DirectoryScanner ds = fs.getDirectoryScanner(getProject());

                if (!FileDirBoth.DIR.equals(currentType)) {
                    String[] s = getFiles(base, ds);
                    for (int j = 0; j < s.length; j++) {
                        totalFiles++;
View Full Code Here

            Vector fileNames = new Vector();
            Vector baseDirs = new Vector();
            for (int i = 0; i < filesets.size(); i++) {
                String currentType = type;
                AbstractFileSet fs = (AbstractFileSet) filesets.elementAt(i);
                if (fs instanceof DirSet) {
                    if (!"dir".equals(type)) {
                        log("Found a nested dirset but type is " + type + ". "
                            + "Temporarily switching to type=\"dir\" on the"
                            + " assumption that you really did mean"
                            + " <dirset> not <fileset>.", Project.MSG_DEBUG);
                        currentType = "dir";
                    }
                }
                File base = fs.getDir(getProject());

                ExtendedDirectoryScanner ds = new ExtendedDirectoryScanner();
                fs.setupDirectoryScanner(ds, getProject());
                ds.setFollowSymlinks(fs.isFollowSymlinks());
                ds.scan();

                if (!"dir".equals(currentType)) {
                    String[] s = getFiles(base, ds);
                    for (int j = 0; j < s.length; j++) {
View Full Code Here

TOP

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

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.