Search in sources :

Example 21 with FileProvider

use of org.apache.tools.ant.types.resources.FileProvider in project ant by apache.

the class XmlProperty method getResource.

/**
 * @return the resource.
 */
protected Resource getResource() {
    // delegate this way around to support subclasses that
    // overwrite getFile
    File f = getFile();
    FileProvider fp = src.as(FileProvider.class);
    return f == null ? src : fp != null && fp.getFile().equals(f) ? src : new FileResource(f);
}
Also used : FileProvider(org.apache.tools.ant.types.resources.FileProvider) FileResource(org.apache.tools.ant.types.resources.FileResource) File(java.io.File)

Example 22 with FileProvider

use of org.apache.tools.ant.types.resources.FileProvider in project ant by apache.

the class ArchiveScanner method setSrc.

/**
 * Sets the src for scanning. This is the jar or zip file that
 * is scanned for matching entries.
 *
 * @param src the (non-null) archive resource
 */
public void setSrc(Resource src) {
    this.src = src;
    FileProvider fp = src.as(FileProvider.class);
    if (fp != null) {
        srcFile = fp.getFile();
    }
}
Also used : FileProvider(org.apache.tools.ant.types.resources.FileProvider)

Aggregations

FileProvider (org.apache.tools.ant.types.resources.FileProvider)22 BuildException (org.apache.tools.ant.BuildException)13 Resource (org.apache.tools.ant.types.Resource)13 FileResource (org.apache.tools.ant.types.resources.FileResource)12 File (java.io.File)8 IOException (java.io.IOException)4 ArchiveResource (org.apache.tools.ant.types.resources.ArchiveResource)4 ResourceCollection (org.apache.tools.ant.types.ResourceCollection)3 URL (java.net.URL)2 Path (java.nio.file.Path)2 PosixFileAttributeView (java.nio.file.attribute.PosixFileAttributeView)2 ArrayList (java.util.ArrayList)2 Vector (java.util.Vector)2 DirectoryScanner (org.apache.tools.ant.DirectoryScanner)2 FileSet (org.apache.tools.ant.types.FileSet)2 URLProvider (org.apache.tools.ant.types.resources.URLProvider)2 ZipResource (org.apache.tools.ant.types.resources.ZipResource)2 ZipFile (org.apache.tools.zip.ZipFile)2 OverrideOnDemand (com.helger.commons.annotation.OverrideOnDemand)1 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)1