Examples of FileProvider


Examples of org.apache.tools.ant.types.resources.FileProvider

        src.setSystemId(resourceToURI(resource));
        return src;
    }

    private String resourceToURI(Resource resource) {
        FileProvider fp = resource.as(FileProvider.class);
        if (fp != null) {
            return FILE_UTILS.toURI(fp.getFile().getAbsolutePath());
        }
        URLProvider up = resource.as(URLProvider.class);
        if (up != null) {
            URL u = up.getURL();
            return String.valueOf(u);
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

        if (source instanceof File) {
            buildFile = (File) source;
        } else if (source instanceof URL) {
            url = (URL) source;
        } else if (source instanceof Resource) {
            FileProvider fp =
                ((Resource) source).as(FileProvider.class);
            if (fp != null) {
                buildFile = fp.getFile();
            } else {
                URLProvider up =
                    ((Resource) source).as(URLProvider.class);
                if (up != null) {
                    url = up.getURL();
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

    public static
        ArchiveInputStream getInputStream(ArchiveStreamFactory factory,
                                          Resource r, String encoding)
        throws IOException {
        if (isFileCombination(factory, r)) {
            FileProvider p = (FileProvider) r.as(FileProvider.class);
            FileAwareArchiveStreamFactory f =
                (FileAwareArchiveStreamFactory) factory;
            return f.getArchiveInputStream(p.getFile(), encoding);
        }
        return null;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

    public static
        ArchiveOutputStream getOutputStream(ArchiveStreamFactory factory,
                                            Resource r, String encoding)
        throws IOException {
        if (isFileCombination(factory, r)) {
            FileProvider p = (FileProvider) r.as(FileProvider.class);
            FileAwareArchiveStreamFactory f =
                (FileAwareArchiveStreamFactory) factory;
            return f.getArchiveOutputStream(p.getFile(), encoding);
        }
        return null;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

    public static
        CompressorInputStream getInputStream(CompressorStreamFactory factory,
                                             Resource r)
        throws IOException {
        if (isFileCombination(factory, r)) {
            FileProvider p = (FileProvider) r.as(FileProvider.class);
            FileAwareCompressorStreamFactory f =
                (FileAwareCompressorStreamFactory) factory;
            return f.getCompressorInputStream(p.getFile());
        }
        return null;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

    public static
        CompressorOutputStream getOutputStream(CompressorStreamFactory factory,
                                               Resource r)
        throws IOException {
        if (isFileCombination(factory, r)) {
            FileProvider p = (FileProvider) r.as(FileProvider.class);
            FileAwareCompressorStreamFactory f =
                (FileAwareCompressorStreamFactory) factory;
            return f.getCompressorOutputStream(p.getFile());
        }
        return null;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

     */
    protected void fillMapsFromArchive(Resource src, String encoding,
                                       Map fileEntries, Map matchFileEntries,
                                       Map dirEntries, Map matchDirEntries) {

        FileProvider fp = (FileProvider) src.as(FileProvider.class);
        if (fp == null) {
            super.fillMapsFromArchive(src, encoding, fileEntries,
                                      matchFileEntries, dirEntries,
                                      matchDirEntries);
            return;
        }

        File srcFile = fp.getFile();
        ZipArchiveEntry entry = null;
        ZipFile zf = null;

        try {
            try {
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

                throw new BuildException(message);
            }
        }

        File importedFile = null;
        FileProvider fp = importedResource.as(FileProvider.class);
        if (fp != null) {
            importedFile = fp.getFile();
        }

        if (!isInIncludeMode() &&
            (importStack.contains(importedResource)
             || (importedFile != null && importStack.contains(importedFile))
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

            }
            if (resource.isDirectory() && doFilesonly) {
                continue;
            }
            File base = null;
            FileProvider fp = resource.as(FileProvider.class);
            if (fp != null) {
                base = ResourceUtils.asFileResource(fp).getBaseDir();
            }

            if (resource.isDirectory()) {
View Full Code Here

Examples of org.apache.tools.ant.types.resources.FileProvider

                newerResources[i] = new Resource[] {};
                continue;
            }

            for (int j = 0; j < initialResources[i].length; j++) {
                FileProvider fp =
                    initialResources[i][j].as(FileProvider.class);
                if (fp != null && zipFile.equals(fp.getFile())) {
                    throw new BuildException("A zip file cannot include "
                                             + "itself", getLocation());
                }
            }
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.