/** * Append to the command arguments if the specified matcher matches. * * <p> * Arguments can be collections or arrays and will be automatically expanded. * * @param m The matcher. * @param args The command line arguments if matcher matches. * @return This object (for method chaining). */ public ProcBuilder appendIf(Matcher m, Object...args) { if (m.matches()) pb.command().addAll(toList(args)); return this; }
/** * Append to the command arguments if the specified matcher matches. * * <p> * Arguments can be collections or arrays and will be automatically expanded. * * @param m The matcher. * @param args The command line arguments if matcher matches. * @return This object (for method chaining). */ public ProcBuilder appendIf(Matcher m, Object...args) { if (m.matches()) pb.command().addAll(toList(args)); return this; }
/** * Append to the command arguments if the specified matcher matches. * * <p> * Arguments can be collections or arrays and will be automatically expanded. * * @param m The matcher. * @param args The command line arguments if matcher matches. * @return This object (for method chaining). */ public ProcBuilder appendIf(Matcher m, Object...args) { if (m.matches()) pb.command().addAll(toList(args)); return this; }
/** * Command arguments if the specified matcher matches. * * <p> * Can be used for specifying OS-specific commands. * * <h5 class='section'>Example:</h5> * <p class='bcode w800'> * ProcBuilder pb = ProcBuilder * .create() * .commandIf(<jsf>WINDOWS</jsf>, <js>"cmd /c dir"</js>) * .commandIf(<jsf>UNIX</jsf>, <js>"bash -c ls"</js>) * .merge() * .execute(); * </p> * * @param m The matcher. * @param args The command line arguments if matcher matches. * @return This object (for method chaining). */ public ProcBuilder commandIf(Matcher m, Object...args) { if (m.matches()) pb.command(toList(args)); return this; }
/** * Command arguments if the specified matcher matches. * * <p> * Can be used for specifying OS-specific commands. * * <h5 class='section'>Example:</h5> * <p class='bcode w800'> * ProcBuilder pb = ProcBuilder * .create() * .commandIf(<jsf>WINDOWS</jsf>, <js>"cmd /c dir"</js>) * .commandIf(<jsf>UNIX</jsf>, <js>"bash -c ls"</js>) * .merge() * .execute(); * </p> * * @param m The matcher. * @param args The command line arguments if matcher matches. * @return This object (for method chaining). */ public ProcBuilder commandIf(Matcher m, Object...args) { if (m.matches()) pb.command(toList(args)); return this; }
/** * Command arguments if the specified matcher matches. * * <p> * Can be used for specifying OS-specific commands. * * <h5 class='section'>Example:</h5> * <p class='bcode w800'> * ProcBuilder pb = ProcBuilder * .create() * .commandIf(<jsf>WINDOWS</jsf>, <js>"cmd /c dir"</js>) * .commandIf(<jsf>UNIX</jsf>, <js>"bash -c ls"</js>) * .merge() * .execute(); * </p> * * @param m The matcher. * @param args The command line arguments if matcher matches. * @return This object (for method chaining). */ public ProcBuilder commandIf(Matcher m, Object...args) { if (m.matches()) pb.command(toList(args)); return this; }