/** * Append the contents of the other Path instance to this. * @param other a <code>Path</code> to be added to the path */ public void append(Path other) { if (other == null) { return; } add(other); }
/** * Add a set of files (nested fileset attribute). * * @param fs The fileset. */ public void addFileset(FileSet fs) { createAttachments().add(fs); }
/** * Add a nested (filesystem-only) ResourceCollection. * @param rc the ResourceCollection to add. */ public void add(ResourceCollection rc) { getPath().add(rc); }
/** * Adds a resource collection to the implicit build path. * * @param rc the resource collection to add. * @since Ant 1.7 */ public void add(ResourceCollection rc) { getBuildpath().add(rc); }
/** * Add a list of target files. * @param fl the FileList to add. */ public void addTargetfilelist(FileList fl) { createTargets().add(fl); }
public void addFileset(FileSet set) { if (path == null) path = new Path(getProject()); path.add(set); }
/** * Add a set of target files. * @param fs the FileSet to add. */ public void addTargetfileset(FileSet fs) { createTargets().add(new HideMissingBasedir(fs)); }
/** * Builds the modulesourcepath for multi module compilation. * @return the modulesourcepath * @since 1.9.7 */ protected Path getModulesourcepath() { final Path msp = new Path(getProject()); if (moduleSourcepath != null) { msp.add(moduleSourcepath); } return msp; }
/** * Creates a nested <code><path></code> element. * @return a <code>Path</code> to be configured * @throws BuildException on error */ public Path createPath() throws BuildException { Path p = new Path(getProject()); add(p); return p; }
createClasspath().add(new Path(getProject(), srcFile.getParentFile().getCanonicalPath())); command = getText(new BufferedReader(new FileReader(srcFile)));
/** * 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()))); } }
/** * Adds a nested <code><fileset></code> element. * @param fs a <code>FileSet</code> to be added to the path * @throws BuildException on error */ public void addFileset(FileSet fs) throws BuildException { if (fs.getProject() == null) { fs.setProject(getProject()); } add(fs); }
/** * Adds a nested <code><filelist></code> element. * @param fl a <code>FileList</code> to be added to the path * @throws BuildException on error */ public void addFilelist(FileList fl) throws BuildException { if (fl.getProject() == null) { fl.setProject(getProject()); } add(fl); }
/** * Adds a nested <code><dirset></code> element. * @param dset a <code>DirSet</code> to be added to the path * @throws BuildException on error */ public void addDirset(DirSet dset) throws BuildException { if (dset.getProject() == null) { dset.setProject(getProject()); } add(dset); }
/** * Creates the nested <code><pathelement></code> element. * @return the <code>PathElement</code> to be configured * @throws BuildException on error */ public PathElement createPathElement() throws BuildException { if (isReference()) { throw noChildrenAllowed(); } PathElement pe = new PathElement(); add(pe); return pe; }
private ResourceLoader setupResourceLoader() { if (classpath == null) { classpath = new Path(project); } /* * 'basedir' is added to the path to make sure that relative paths such * as "<ruleset>resources/custom_ruleset.xml</ruleset>" still work when * ant is invoked from a different directory using "-f" */ classpath.add(new Path(null, project.getBaseDir().toString())); project.log("Using the AntClassLoader: " + classpath, Project.MSG_VERBOSE); // must be true, otherwise you'll get ClassCastExceptions as classes // are loaded twice // and exist in multiple class loaders final boolean parentFirst = true; return new ResourceLoader(new AntClassLoader(Thread.currentThread().getContextClassLoader(), project, classpath, parentFirst)); }
/** * clone our path and add all explicitly specified FileSets as * well, patch in the jar attribute as a new fileset if it is * defined. * @return a path that contains all files to sign * @since Ant 1.7 */ protected Path createUnifiedSourcePath() { Path p = path == null ? new Path(getProject()) : (Path) path.clone(); for (FileSet fileSet : createUnifiedSources()) { p.add(fileSet); } return p; }
/** * Adds a nested path * @param path a <code>Path</code> to be added to the path * @throws BuildException on error * @since Ant 1.6 */ public void add(Path path) throws BuildException { if (path == this) { throw circularReference(); } if (path.getProject() == null) { path.setProject(getProject()); } add((ResourceCollection) path); }
@Test public final void testPathsDirectoryWithNestedFile() throws IOException { // given TestRootModuleChecker.reset(); final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); antTask.setConfig(getPath(CUSTOM_ROOT_CONFIG_FILE)); antTask.setProject(new Project()); final FileResource fileResource = new FileResource( antTask.getProject(), getPath("")); final Path sourcePath = new Path(antTask.getProject()); sourcePath.add(fileResource); antTask.addPath(sourcePath); // when antTask.execute(); // then assertTrue("Checker is not processed", TestRootModuleChecker.isProcessed()); final List<File> filesToCheck = TestRootModuleChecker.getFilesToCheck(); assertThat("There more files to check then expected", filesToCheck.size(), is(9)); assertThat("The path of file differs from expected", filesToCheck.get(6).getAbsolutePath(), is(getPath(FLAWLESS_INPUT))); assertEquals("Amount of logged messages in unexpected", 8, antTask.getLoggedMessages().size()); }
public void setDestdir( File outputDirectory ) { this.destdir = outputDirectory; if ( destdir != null ) { Path dst = new Path( getProject() ); dst.setLocation( destdir ); createClasspath().add( dst ); } }