/** * Sets the resource to search * @param r the value to use. */ public void setResource(String r) { this.resource = new FileResource(new File(r)); }
/** * The name of a property file from which properties specified using nested * <code><replacefilter></code> elements are drawn; required only if * the <i>property</i> attribute of <code><replacefilter></code> is used. * @param propertyFile <code>File</code> to load. */ public void setPropertyFile(File propertyFile) { setPropertyResource(new FileResource(propertyFile)); }
/** * the file to compress; required. * @param src the source file */ public void setSrc(File src) { setSrcResource(new FileResource(src)); }
/** * Set the source file attribute. * @param src the source file */ public void setSrc(File src) { //there are places (in this file, and perhaps elsewhere, where it is assumed //that null is an acceptable parameter. if (src != null) { setSrcResource(new FileResource(src)); } }
/** * The heart of the matter. This is where the selector gets to decide * on the inclusion of a file in a particular fileset. * * @param basedir the base directory the scan is being done from * @param filename is the name of the file to check * @param file is a java.io.File object the selector can use * @return whether the file should be selected or not */ public boolean isSelected(File basedir, String filename, File file) { return isSelected(new FileResource(file)); }
/** * Set the single file for this task. * @param file the <code>File</code> whose length to retrieve. */ public synchronized void setFile(File file) { add(new FileResource(file)); }
/** * zip a file to an output stream * @param file the file to zip * @param zOut the output stream * @throws IOException on error */ protected void zipFile(File file, OutputStream zOut) throws IOException { zipResource(new FileResource(file), zOut); }
/** * Sets the srcFile for scanning. This is the jar or zip file that * is scanned for matching entries. * * @param srcFile the (non-null) archive file name for scanning */ public void setSrc(File srcFile) { setSrc(new FileResource(srcFile)); }
/** * Tests a regular expression against each line of text in the file. * * @param basedir the base directory the scan is being done from * @param filename is the name of the file to check * @param file is a java.io.File object the selector can use * @return whether the file should be selected or not */ public boolean isSelected(File basedir, String filename, File file) { return isSelected(new FileResource(file)); }
@Override void set(final Project p, final Object parent, final String value) throws InvocationTargetException, IllegalAccessException, BuildException { m.invoke(parent, new FileResource(p, p.resolveFile(value))); } };
/** * Sets the destination file, or uses the console if not specified. * @param destinationFile the destination file */ public void setDestfile(File destinationFile) { setDest(new FileResource(destinationFile)); }
/** * Set a single target File. * @param f the single File */ public void setFile(File f) { add(new FileResource(f)); }
/** * The file to expand; required. * @param src file to expand */ public void setSrc(File src) { setSrcResource(new FileResource(src)); }
/** * Set the file to load. * * @param srcFile The new SrcFile value */ public final void setSrcFile(final File srcFile) { addConfigured(new FileResource(srcFile)); }
/** * Sets the name of a property file containing filters; optional. * Each property will be treated as a replacefilter where token is the name * of the property and value is the value of the property. * @param replaceFilterFile <code>File</code> to load. */ public void setReplaceFilterFile(File replaceFilterFile) { setReplaceFilterResource(new FileResource(getProject(), replaceFilterFile)); }
/** * Load a properties file. * @param propertyFile the file to load the properties from. * @return loaded <code>Properties</code> object. * @throws BuildException if the file could not be found or read. */ public Properties getProperties(File propertyFile) throws BuildException { return getProperties(new FileResource(getProject(), propertyFile)); }
/** * Set the output file; * optional, defaults to the Ant log. * @param output the output file to use for logging messages. */ public void setOutput(File output) { setOutput(new FileResource(getProject(), output)); }
/** * Set the list of files to be attached. * * @param filenames Comma-separated list of files. */ public void setFiles(String filenames) { StringTokenizer t = new StringTokenizer(filenames, ", "); while (t.hasMoreTokens()) { createAttachments() .add(new FileResource(getProject().resolveFile(t.nextToken()))); } }
/** * @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); }
/** * Set the stylesheet file. * @param stylesheet a <code>File</code> value * @throws Exception on error */ public void setStylesheet(final File stylesheet) throws Exception { final FileResource fr = new FileResource(); fr.setProject(project); fr.setFile(stylesheet); setStylesheet(fr); }