private boolean haveEntries(Path p) { return !(p == null || p.isEmpty()); } }
/** * Checks if a path exists and is non empty. * @param path to be checked * @return true if the path is non <code>null</code> and non empty. * @since 1.9.7 */ private static boolean hasPath(final Path path) { return path != null && !path.isEmpty(); }
private void checkPackages(final List<String> packagesToDoc, final Path sourceDirs) { if (!packagesToDoc.isEmpty() && sourceDirs.isEmpty()) { throw new BuildException( "sourcePath attribute must be set when specifying package names."); } }
private void doSourcePath(final Commandline toExecute, final Path sourceDirs) { if (!sourceDirs.isEmpty()) { toExecute.createArgument().setValue("-sourcepath"); toExecute.createArgument().setPath(sourceDirs); } }
/** * Execute the task. * @throws BuildException if errors occur. */ @Override public void execute() throws BuildException { if (sources == null) { throw new BuildException( "At least one set of source resources must be specified"); } if (targets == null) { throw new BuildException( "At least one set of target files must be specified"); } //no sources = nothing to compare; no targets = nothing to delete: if (!sources.isEmpty() && !targets.isEmpty() && !uptodate(sources, targets)) { log("Deleting all target files.", Project.MSG_VERBOSE); if (verbose) { for (String t : targets.list()) { log("Deleting " + t); } } Delete delete = new Delete(); delete.bindToOwner(this); delete.add(targets); delete.perform(); } }
final Path tagletPath = tagletInfo.getPath() .concatSystemClasspath("ignore"); if (!tagletPath.isEmpty()) { toExecute.createArgument() .setValue("-tagletpath");
if (!p.isEmpty()) { classpath.append(p);
if (!sourcepath.isEmpty()) { cmd.createArgument().setValue("-sourcepath"); cmd.createArgument().setPath(sourcepath); if (bootclasspath == null || bootclasspath.isEmpty()) { if (extdirs != null && !extdirs.isEmpty()) { cmd.createArgument().setValue("-extdirs"); cmd.createArgument().setPath(extdirs); if (!boot.isEmpty()) { cmd.createArgument().setValue("-bootclasspath"); cmd.createArgument().setPath(boot);
if (!msp.isEmpty()) { cmd.createArgument().setValue("--module-source-path"); cmd.createArgument().setPath(msp); if (!mp.isEmpty()) { cmd.createArgument().setValue("--module-path"); cmd.createArgument().setPath(mp); if (!ump.isEmpty()) { cmd.createArgument().setValue("--upgrade-module-path"); cmd.createArgument().setPath(ump);
if (!p.isEmpty()) { cp.append(p);
if (!p.isEmpty()) { classpath.append(p);