001package org.unix4j.builder; 002 003import org.unix4j.builder.CommandBuilder; 004import org.unix4j.command.Command; 005import org.unix4j.operation.LineOperation; 006 007import org.unix4j.unix.Cat; 008import org.unix4j.unix.cat.CatOptions; 009import org.unix4j.unix.Cd; 010import org.unix4j.unix.Cut; 011import org.unix4j.unix.cut.CutOptions; 012import org.unix4j.unix.Echo; 013import org.unix4j.unix.echo.EchoOptions; 014import org.unix4j.unix.Find; 015import org.unix4j.unix.find.FindOptions; 016import org.unix4j.unix.From; 017import org.unix4j.unix.Grep; 018import org.unix4j.unix.grep.GrepOptions; 019import org.unix4j.unix.Head; 020import org.unix4j.unix.head.HeadOptions; 021import org.unix4j.unix.Ls; 022import org.unix4j.unix.ls.LsOptions; 023import org.unix4j.unix.Sed; 024import org.unix4j.unix.sed.SedOptions; 025import org.unix4j.unix.Sort; 026import org.unix4j.unix.sort.SortOptions; 027import org.unix4j.unix.Tail; 028import org.unix4j.unix.tail.TailOptions; 029import org.unix4j.unix.Uniq; 030import org.unix4j.unix.uniq.UniqOptions; 031import org.unix4j.unix.Wc; 032import org.unix4j.unix.wc.WcOptions; 033import org.unix4j.unix.Xargs; 034import org.unix4j.unix.xargs.XargsOptions; 035 036/** 037 * Builder for a <b>unix4j</b> command or a chain of joined commands. 038 * Application code does usually not directly refer to this class but uses it 039 * indirectly through the static methods in {@link org.unix4j.Unix4j Unix4j}. 040 * <p> 041 * Note that the command creation methods do not return a new command instance. 042 * Instead, the builder stores the created commands and only returns a 043 * {@link Command} object when the {@link #build()} method is invoked. Most 044 * applications, however, need not to call {@code build()} explicitly. The 045 * command can be built and executed in a single step by calling one of the 046 * {@code toXXX(..)} methods, such as {@link #toStdOut()}, 047 * {@link #toFile(String)} or {@link #toStringResult()}. 048 * <p> 049 * The {@link Command} object returned by the {@link #build()} method can 050 * represent a single command or a chain of commands. In a command chain, the 051 * previous command usually pipes its output as standard input into the 052 * next command (the pipe symbol between two commands in unix). For come 053 * commands, however, chaining has a different interpretation. An example is the 054 * {@code xargs} command: here, the next command after {@code xargs} receives 055 * <i>arguments</i> from {@code xargs} instead of (standard) input. 056 */ 057public interface Unix4jCommandBuilder extends CommandBuilder, 058 Cat.Interface<Unix4jCommandBuilder>, 059 Cd.Interface<Unix4jCommandBuilder>, 060 Cut.Interface<Unix4jCommandBuilder>, 061 Echo.Interface<Unix4jCommandBuilder>, 062 Find.Interface<Unix4jCommandBuilder>, 063 From.Interface<Unix4jCommandBuilder>, 064 Grep.Interface<Unix4jCommandBuilder>, 065 Head.Interface<Unix4jCommandBuilder>, 066 Ls.Interface<Unix4jCommandBuilder>, 067 Sed.Interface<Unix4jCommandBuilder>, 068 Sort.Interface<Unix4jCommandBuilder>, 069 Tail.Interface<Unix4jCommandBuilder>, 070 Uniq.Interface<Unix4jCommandBuilder>, 071 Wc.Interface<Unix4jCommandBuilder>, 072 Xargs.Interface<Unix4jCommandBuilder> { 073 074 075 /* ------------------ cat ------------------ */ 076 /** 077 * Reads the lines from the standard input and writes them to the 078 standard output. 079 * <p> 080 * Note that the method returns {@code this} builder to allow for command 081 * chaining. The command itself is returned by the {@link #build()} method. 082 * See {@link Unix4jCommandBuilder class comments} for more information. 083 * 084 * @return {@code this} builder to allow for method chaining; method 085 * chaining is used here to create command chains; adding a command 086 * to the chain usually means that the previous command <i>pipes</i> 087 * its output to the next command (the pipe symbol in unix) 088 */ 089 @Override 090 Unix4jCommandBuilder cat(); 091 /** 092 * Reads the lines from files specified as arguments and writes them to 093 the standard output. Options can be specified by acronym (with a 094 leading dash "-") or by long name (with two leading dashes "--"). 095 File arguments are expanded if wildcards are used. All file 096 arguments are processed in command-argument order. 097 * <p> 098 * Note that the method returns {@code this} builder to allow for command 099 * chaining. The command itself is returned by the {@link #build()} method. 100 * See {@link Unix4jCommandBuilder class comments} for more information. 101 * 102 * @param args String arguments defining the options and file operands for the 103 command. Options can be specified by acronym (with a leading dash 104 "-") or by long name (with two leading dashes "--"). File arguments 105 are expanded if wildcards are used. 106 * @return {@code this} builder to allow for method chaining; method 107 * chaining is used here to create command chains; adding a command 108 * to the chain usually means that the previous command <i>pipes</i> 109 * its output to the next command (the pipe symbol in unix) 110 */ 111 @Override 112 Unix4jCommandBuilder cat(String... args); 113 /** 114 * Reads the lines from the specified files and writes them to the 115 standard output. The files are processed in command-argument order. 116 * <p> 117 * Note that the method returns {@code this} builder to allow for command 118 * chaining. The command itself is returned by the {@link #build()} method. 119 * See {@link Unix4jCommandBuilder class comments} for more information. 120 * 121 * @param files The input files to be printed; relative paths are not resolved (use 122 the string path argument to enable relative path resolving based on 123 the current working directory). 124 * @return {@code this} builder to allow for method chaining; method 125 * chaining is used here to create command chains; adding a command 126 * to the chain usually means that the previous command <i>pipes</i> 127 * its output to the next command (the pipe symbol in unix) 128 */ 129 @Override 130 Unix4jCommandBuilder cat(java.io.File... files); 131 /** 132 * Reads the lines from the standard input and writes them to the 133 standard output; the given options define the details of the output 134 format. 135 * <p> 136 * Note that the method returns {@code this} builder to allow for command 137 * chaining. The command itself is returned by the {@link #build()} method. 138 * See {@link Unix4jCommandBuilder class comments} for more information. 139 * 140 * @param options Options for the cat command. 141 * @return {@code this} builder to allow for method chaining; method 142 * chaining is used here to create command chains; adding a command 143 * to the chain usually means that the previous command <i>pipes</i> 144 * its output to the next command (the pipe symbol in unix) 145 */ 146 @Override 147 Unix4jCommandBuilder cat(CatOptions options); 148 /** 149 * Reads the lines from the specified files and writes them to the 150 standard output; the given options define the details of the output 151 format. The files are processed in command-argument order. 152 * <p> 153 * Note that the method returns {@code this} builder to allow for command 154 * chaining. The command itself is returned by the {@link #build()} method. 155 * See {@link Unix4jCommandBuilder class comments} for more information. 156 * 157 * @param options Options for the cat command. 158 * @param files The input files to be printed; relative paths are not resolved (use 159 the string path argument to enable relative path resolving based on 160 the current working directory). 161 * @return {@code this} builder to allow for method chaining; method 162 * chaining is used here to create command chains; adding a command 163 * to the chain usually means that the previous command <i>pipes</i> 164 * its output to the next command (the pipe symbol in unix) 165 */ 166 @Override 167 Unix4jCommandBuilder cat(CatOptions options, java.io.File... files); 168 /** 169 * Reads the lines from the specified files and writes them to the 170 standard output; the given options define the details of the output 171 format. The path arguments are expanded if wildcards are used and 172 processed in command-argument order. 173 * <p> 174 * Note that the method returns {@code this} builder to allow for command 175 * chaining. The command itself is returned by the {@link #build()} method. 176 * See {@link Unix4jCommandBuilder class comments} for more information. 177 * 178 * @param options Options for the cat command. 179 * @param paths Pathnames of the input files to be printed; wildcards * and ? are 180 supported; relative paths are resolved on the basis of the current 181 working directory. 182 * @return {@code this} builder to allow for method chaining; method 183 * chaining is used here to create command chains; adding a command 184 * to the chain usually means that the previous command <i>pipes</i> 185 * its output to the next command (the pipe symbol in unix) 186 */ 187 @Override 188 Unix4jCommandBuilder cat(CatOptions options, String... paths); 189 190 /* ------------------ cd ------------------ */ 191 /** 192 * Changes the current directory to the user home directory as defined 193 by the execution context (usually the directory specified by the 194 {@code "user.home"} system property). 195 * <p> 196 * Note that the method returns {@code this} builder to allow for command 197 * chaining. The command itself is returned by the {@link #build()} method. 198 * See {@link Unix4jCommandBuilder class comments} for more information. 199 * 200 * @return {@code this} builder to allow for method chaining; method 201 * chaining is used here to create command chains; adding a command 202 * to the chain usually means that the previous command <i>pipes</i> 203 * its output to the next command (the pipe symbol in unix) 204 */ 205 @Override 206 Unix4jCommandBuilder cd(); 207 /** 208 * The current working directory is changed to the given file. If the 209 specified file argument does not represent a valid directory, an 210 exception is thrown. Note that relative paths are not resolved with 211 the (old) current working directory. Use the String path to enable 212 relative path resolving and wildcards. 213 * <p> 214 * Note that the method returns {@code this} builder to allow for command 215 * chaining. The command itself is returned by the {@link #build()} method. 216 * See {@link Unix4jCommandBuilder class comments} for more information. 217 * 218 * @param file the file to use as input; relative paths are not resolved (use the 219 string path argument to enable relative path resolving based on the 220 current working directory). 221 * @return {@code this} builder to allow for method chaining; method 222 * chaining is used here to create command chains; adding a command 223 * to the chain usually means that the previous command <i>pipes</i> 224 * its output to the next command (the pipe symbol in unix) 225 */ 226 @Override 227 Unix4jCommandBuilder cd(java.io.File file); 228 /** 229 * The current working directory is changed to the given file. Relative 230 paths are resolved on the basis of the (old) current working 231 directory. Wildcards are possible if the first matching file 232 represents a directory. If the first file specified by the given 233 path argument is not a valid directory, an exception is thrown. 234 * <p> 235 * Note that the method returns {@code this} builder to allow for command 236 * chaining. The command itself is returned by the {@link #build()} method. 237 * See {@link Unix4jCommandBuilder class comments} for more information. 238 * 239 * @param path the directory to become the new current working directory; 240 wildcards * and ? are supported; relative paths are resolved on the 241 basis of the current working directory. 242 * @return {@code this} builder to allow for method chaining; method 243 * chaining is used here to create command chains; adding a command 244 * to the chain usually means that the previous command <i>pipes</i> 245 * its output to the next command (the pipe symbol in unix) 246 */ 247 @Override 248 Unix4jCommandBuilder cd(String path); 249 250 /* ------------------ cut ------------------ */ 251 /** 252 * Cuts the fields or characters from the input line and writes them to 253 the standard output. Depending on the provided options and operands, 254 range, delimiter or indexes define the cut. 255 * <p> 256 * Note that the method returns {@code this} builder to allow for command 257 * chaining. The command itself is returned by the {@link #build()} method. 258 * See {@link Unix4jCommandBuilder class comments} for more information. 259 * 260 * @param args String arguments defining the options and operands for the command. 261 Options can be specified by acronym (with a leading dash "-") or by 262 long name (with two leading dashes "--"). Operands other than the 263 default "--range" operand have to be prefixed with the operand name 264 (e.g. "--indexes" for subsequent index operand values). 265 * @return {@code this} builder to allow for method chaining; method 266 * chaining is used here to create command chains; adding a command 267 * to the chain usually means that the previous command <i>pipes</i> 268 * its output to the next command (the pipe symbol in unix) 269 */ 270 @Override 271 Unix4jCommandBuilder cut(String... args); 272 /** 273 * Cuts the fields or characters using the given range 274 from the input line and writes them to the output. 275 * <p> 276 * Note that the method returns {@code this} builder to allow for command 277 * chaining. The command itself is returned by the {@link #build()} method. 278 * See {@link Unix4jCommandBuilder class comments} for more information. 279 * 280 * @param options options for the cut command 281 * @param range select only these fields 282 * @return {@code this} builder to allow for method chaining; method 283 * chaining is used here to create command chains; adding a command 284 * to the chain usually means that the previous command <i>pipes</i> 285 * its output to the next command (the pipe symbol in unix) 286 */ 287 @Override 288 Unix4jCommandBuilder cut(CutOptions options, org.unix4j.util.Range range); 289 /** 290 * Cuts the fields or characters using the given indexes 291 from the input line and writes them to the output. 292 * <p> 293 * Note that the method returns {@code this} builder to allow for command 294 * chaining. The command itself is returned by the {@link #build()} method. 295 * See {@link Unix4jCommandBuilder class comments} for more information. 296 * 297 * @param options options for the cut command 298 * @param indexes select these chars/field based on the given indexes. Indexes are 1 based. i.e. the first character/field on a line has an index of 1. 299 * @return {@code this} builder to allow for method chaining; method 300 * chaining is used here to create command chains; adding a command 301 * to the chain usually means that the previous command <i>pipes</i> 302 * its output to the next command (the pipe symbol in unix) 303 */ 304 @Override 305 Unix4jCommandBuilder cut(CutOptions options, int... indexes); 306 /** 307 * Cuts the fields using the given range 308 from the input line and writes them to the output. 309 * <p> 310 * Note that the method returns {@code this} builder to allow for command 311 * chaining. The command itself is returned by the {@link #build()} method. 312 * See {@link Unix4jCommandBuilder class comments} for more information. 313 * 314 * @param options options for the cut command 315 * @param delimiter use as the output delimiter the default is to use the input delimiter 316 * @param range select only these fields 317 * @return {@code this} builder to allow for method chaining; method 318 * chaining is used here to create command chains; adding a command 319 * to the chain usually means that the previous command <i>pipes</i> 320 * its output to the next command (the pipe symbol in unix) 321 */ 322 @Override 323 Unix4jCommandBuilder cut(CutOptions options, String delimiter, org.unix4j.util.Range range); 324 /** 325 * Cuts the fields using the given indexes 326 from the input line and writes them to the output. 327 * <p> 328 * Note that the method returns {@code this} builder to allow for command 329 * chaining. The command itself is returned by the {@link #build()} method. 330 * See {@link Unix4jCommandBuilder class comments} for more information. 331 * 332 * @param options options for the cut command 333 * @param delimiter use as the output delimiter the default is to use the input delimiter 334 * @param indexes select these chars/field based on the given indexes. Indexes are 1 based. i.e. the first character/field on a line has an index of 1. 335 * @return {@code this} builder to allow for method chaining; method 336 * chaining is used here to create command chains; adding a command 337 * to the chain usually means that the previous command <i>pipes</i> 338 * its output to the next command (the pipe symbol in unix) 339 */ 340 @Override 341 Unix4jCommandBuilder cut(CutOptions options, String delimiter, int... indexes); 342 /** 343 * Cuts the fields using the given range and using the given delimiter 344 from the input line and writes them to the output using the given outputDelimiter. 345 * <p> 346 * Note that the method returns {@code this} builder to allow for command 347 * chaining. The command itself is returned by the {@link #build()} method. 348 * See {@link Unix4jCommandBuilder class comments} for more information. 349 * 350 * @param options options for the cut command 351 * @param delimiter use as the output delimiter the default is to use the input delimiter 352 * @param outputDelimiter use as the output delimiter the default is to use the input delimiter 353 * @param range select only these fields 354 * @return {@code this} builder to allow for method chaining; method 355 * chaining is used here to create command chains; adding a command 356 * to the chain usually means that the previous command <i>pipes</i> 357 * its output to the next command (the pipe symbol in unix) 358 */ 359 @Override 360 Unix4jCommandBuilder cut(CutOptions options, String delimiter, char outputDelimiter, org.unix4j.util.Range range); 361 /** 362 * Cuts the fields using the given indexes and using the given delimiter 363 from the input line and writes them to the output using the given outputDelimiter. 364 * <p> 365 * Note that the method returns {@code this} builder to allow for command 366 * chaining. The command itself is returned by the {@link #build()} method. 367 * See {@link Unix4jCommandBuilder class comments} for more information. 368 * 369 * @param options options for the cut command 370 * @param delimiter use as the output delimiter the default is to use the input delimiter 371 * @param outputDelimiter use as the output delimiter the default is to use the input delimiter 372 * @param indexes select these chars/field based on the given indexes. Indexes are 1 based. i.e. the first character/field on a line has an index of 1. 373 * @return {@code this} builder to allow for method chaining; method 374 * chaining is used here to create command chains; adding a command 375 * to the chain usually means that the previous command <i>pipes</i> 376 * its output to the next command (the pipe symbol in unix) 377 */ 378 @Override 379 Unix4jCommandBuilder cut(CutOptions options, String delimiter, char outputDelimiter, int... indexes); 380 381 /* ------------------ echo ------------------ */ 382 /** 383 * Writes any of the specified strings, separated by single blank 384 ({@code ' '}) characters to the standard output suppressing the 385 trailing line ending if the {@code "-n"} option is specified. 386 * <p> 387 * Note that the method returns {@code this} builder to allow for command 388 * chaining. The command itself is returned by the {@link #build()} method. 389 * See {@link Unix4jCommandBuilder class comments} for more information. 390 * 391 * @param args String arguments defining the options for the command and the 392 strings to be written to the output. Options can be specified by 393 acronym (with a leading dash "-") or by long name (with two leading 394 dashes "--"). 395 * @return {@code this} builder to allow for method chaining; method 396 * chaining is used here to create command chains; adding a command 397 * to the chain usually means that the previous command <i>pipes</i> 398 * its output to the next command (the pipe symbol in unix) 399 */ 400 @Override 401 Unix4jCommandBuilder echo(String... args); 402 /** 403 * Writes the specified string followed by a newline character to 404 the standard output suppressing the trailing line ending if the 405 {@code -n} option is specified. 406 * <p> 407 * Note that the method returns {@code this} builder to allow for command 408 * chaining. The command itself is returned by the {@link #build()} method. 409 * See {@link Unix4jCommandBuilder class comments} for more information. 410 * 411 * @param options Options for the echo command. 412 * @param string A string to be written to standard output. 413 * @return {@code this} builder to allow for method chaining; method 414 * chaining is used here to create command chains; adding a command 415 * to the chain usually means that the previous command <i>pipes</i> 416 * its output to the next command (the pipe symbol in unix) 417 */ 418 @Override 419 Unix4jCommandBuilder echo(EchoOptions options, String string); 420 /** 421 * Writes any of the specified strings, separated by single blank 422 ({@code ' '}) characters to the standard output suppressing the 423 trailing line ending if the {@code -n} option is specified. 424 * <p> 425 * Note that the method returns {@code this} builder to allow for command 426 * chaining. The command itself is returned by the {@link #build()} method. 427 * See {@link Unix4jCommandBuilder class comments} for more information. 428 * 429 * @param options Options for the echo command. 430 * @param strings Strings to be written to standard output, separated by single blank 431 characters. 432 * @return {@code this} builder to allow for method chaining; method 433 * chaining is used here to create command chains; adding a command 434 * to the chain usually means that the previous command <i>pipes</i> 435 * its output to the next command (the pipe symbol in unix) 436 */ 437 @Override 438 Unix4jCommandBuilder echo(EchoOptions options, String... strings); 439 440 /* ------------------ find ------------------ */ 441 /** 442 * Finds all files matching the search criteria specified by the given 443 arguments and writes the file names to the standard output. 444 <p> 445 Options can be specified by acronym (with a leading dash "-") or by 446 long name (with two leading dashes "--"). Operands other than the 447 default "--name" operand have to be prefixed with the operand name. 448 <p> 449 The files names written to the output are relative paths referring 450 to the working directory (or -- if provided -- relative to the path 451 given after the {@code "--path"} operand name). 452 * <p> 453 * Note that the method returns {@code this} builder to allow for command 454 * chaining. The command itself is returned by the {@link #build()} method. 455 * See {@link Unix4jCommandBuilder class comments} for more information. 456 * 457 * @param args String arguments defining the options and operands for the command. 458 Options can be specified by acronym (with a leading dash "-") or by 459 long name (with two leading dashes "--"). Operands other than the 460 default "--path" operand have to be prefixed with the operand name 461 (e.g. "--name" for subsequent path operand values). 462 * @return {@code this} builder to allow for method chaining; method 463 * chaining is used here to create command chains; adding a command 464 * to the chain usually means that the previous command <i>pipes</i> 465 * its output to the next command (the pipe symbol in unix) 466 */ 467 @Override 468 Unix4jCommandBuilder find(String... args); 469 /** 470 * Finds all files in or below the directory specified by {@code path} 471 and writes the file names to the standard output. 472<p> 473 The files names written to the output are paths relative to the 474 specified {@code path} operand. 475 * <p> 476 * Note that the method returns {@code this} builder to allow for command 477 * chaining. The command itself is returned by the {@link #build()} method. 478 * See {@link Unix4jCommandBuilder class comments} for more information. 479 * 480 * @param path Starting point for the search in the directory hierarchy; 481 wildcards * and ? are supported; relative paths are resolved on the 482 basis of the current working directory. 483 * @return {@code this} builder to allow for method chaining; method 484 * chaining is used here to create command chains; adding a command 485 * to the chain usually means that the previous command <i>pipes</i> 486 * its output to the next command (the pipe symbol in unix) 487 */ 488 @Override 489 Unix4jCommandBuilder find(String path); 490 /** 491 * Finds all files matching the specified {@code name} in or below the 492 directory specified by {@code path} and writes the file names to 493 the standard output. 494 <p> 495 The files names written to the output are paths relative to the 496 specified {@code path} operand. 497 * <p> 498 * Note that the method returns {@code this} builder to allow for command 499 * chaining. The command itself is returned by the {@link #build()} method. 500 * See {@link Unix4jCommandBuilder class comments} for more information. 501 * 502 * @param path Starting point for the search in the directory hierarchy; 503 wildcards * and ? are supported; relative paths are resolved on the 504 basis of the current working directory. 505 * @param name Name pattern to match the file name after removing the path with the 506 leading directories; wildcards * and ? are supported, or full 507 regular expressions if either of the options {@code -regex (-r)} or 508 {@code -iregex (-i)} is specified. 509 * @return {@code this} builder to allow for method chaining; method 510 * chaining is used here to create command chains; adding a command 511 * to the chain usually means that the previous command <i>pipes</i> 512 * its output to the next command (the pipe symbol in unix) 513 */ 514 @Override 515 Unix4jCommandBuilder find(String path, String name); 516 /** 517 * Finds all files matching the specified file {@code size} in or below 518 the user's current working directory and writes the file names to 519 the standard output. Matching files use at least {@code size} bytes 520 on disk if {@code size} is positive, or at most {@code abs(size)} 521 bytes if {@code size} is zero or negative. 522 <p> 523 The files names written to the output are relative paths referring 524 to the working directory. 525 * <p> 526 * Note that the method returns {@code this} builder to allow for command 527 * chaining. The command itself is returned by the {@link #build()} method. 528 * See {@link Unix4jCommandBuilder class comments} for more information. 529 * 530 * @param size Consider only files using at least {@code size} bytes if {@code size} 531 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 532 or negative. 533 * @return {@code this} builder to allow for method chaining; method 534 * chaining is used here to create command chains; adding a command 535 * to the chain usually means that the previous command <i>pipes</i> 536 * its output to the next command (the pipe symbol in unix) 537 */ 538 @Override 539 Unix4jCommandBuilder find(long size); 540 /** 541 * Finds all files matching the specified file {@code size} in or below 542 the directory specified by {@code path} and writes the file names 543 to the standard output. Matching files use at least {@code size} 544 bytes on disk if {@code size} is positive, or at most 545 {@code abs(size)} bytes if {@code size} is zero or negative. 546<p> 547 The files names written to the output are paths relative to the 548 specified {@code path} operand. 549 * <p> 550 * Note that the method returns {@code this} builder to allow for command 551 * chaining. The command itself is returned by the {@link #build()} method. 552 * See {@link Unix4jCommandBuilder class comments} for more information. 553 * 554 * @param path Starting point for the search in the directory hierarchy; 555 wildcards * and ? are supported; relative paths are resolved on the 556 basis of the current working directory. 557 * @param size Consider only files using at least {@code size} bytes if {@code size} 558 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 559 or negative. 560 * @return {@code this} builder to allow for method chaining; method 561 * chaining is used here to create command chains; adding a command 562 * to the chain usually means that the previous command <i>pipes</i> 563 * its output to the next command (the pipe symbol in unix) 564 */ 565 @Override 566 Unix4jCommandBuilder find(String path, long size); 567 /** 568 * Finds all files matching the specified file {@code name} and 569 {@code size} in or below the user's current working directory and 570 writes the file names to the standard output. Matching files use 571 at least {@code size} bytes on disk if {@code size} is positive, 572 or at most {@code abs(size)} bytes if {@code size} is zero or 573 negative. 574<p> 575 The files names written to the output are relative paths referring 576 to the working directory. 577 * <p> 578 * Note that the method returns {@code this} builder to allow for command 579 * chaining. The command itself is returned by the {@link #build()} method. 580 * See {@link Unix4jCommandBuilder class comments} for more information. 581 * 582 * @param size Consider only files using at least {@code size} bytes if {@code size} 583 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 584 or negative. 585 * @param name Name pattern to match the file name after removing the path with the 586 leading directories; wildcards * and ? are supported, or full 587 regular expressions if either of the options {@code -regex (-r)} or 588 {@code -iregex (-i)} is specified. 589 * @return {@code this} builder to allow for method chaining; method 590 * chaining is used here to create command chains; adding a command 591 * to the chain usually means that the previous command <i>pipes</i> 592 * its output to the next command (the pipe symbol in unix) 593 */ 594 @Override 595 Unix4jCommandBuilder find(long size, String name); 596 /** 597 * Finds all files matching the specified file {@code name} and 598 {@code size} in or below the directory specified by {@code path} 599 and writes the file names to the standard output. Matching files 600 use at least {@code size} bytes on disk if {@code size} is positive, 601 or at most {@code abs(size)} bytes if {@code size} is zero or 602 negative. 603<p> 604 The files names written to the output are paths relative to the 605 specified {@code path} operand. 606 * <p> 607 * Note that the method returns {@code this} builder to allow for command 608 * chaining. The command itself is returned by the {@link #build()} method. 609 * See {@link Unix4jCommandBuilder class comments} for more information. 610 * 611 * @param path Starting point for the search in the directory hierarchy; 612 wildcards * and ? are supported; relative paths are resolved on the 613 basis of the current working directory. 614 * @param size Consider only files using at least {@code size} bytes if {@code size} 615 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 616 or negative. 617 * @param name Name pattern to match the file name after removing the path with the 618 leading directories; wildcards * and ? are supported, or full 619 regular expressions if either of the options {@code -regex (-r)} or 620 {@code -iregex (-i)} is specified. 621 * @return {@code this} builder to allow for method chaining; method 622 * chaining is used here to create command chains; adding a command 623 * to the chain usually means that the previous command <i>pipes</i> 624 * its output to the next command (the pipe symbol in unix) 625 */ 626 @Override 627 Unix4jCommandBuilder find(String path, long size, String name); 628 /** 629 * Finds all files matching the specified {@code name} in or below the 630 user's current working directory and writes the file names to the 631 standard output. 632 <p> 633 The files names written to the output are relative paths referring 634 to the working directory. 635 * <p> 636 * Note that the method returns {@code this} builder to allow for command 637 * chaining. The command itself is returned by the {@link #build()} method. 638 * See {@link Unix4jCommandBuilder class comments} for more information. 639 * 640 * @param options Options for the file search. 641 * @param name Name pattern to match the file name after removing the path with the 642 leading directories; wildcards * and ? are supported, or full 643 regular expressions if either of the options {@code -regex (-r)} or 644 {@code -iregex (-i)} is specified. 645 * @return {@code this} builder to allow for method chaining; method 646 * chaining is used here to create command chains; adding a command 647 * to the chain usually means that the previous command <i>pipes</i> 648 * its output to the next command (the pipe symbol in unix) 649 */ 650 @Override 651 Unix4jCommandBuilder find(FindOptions options, String name); 652 /** 653 * Finds all files matching the specified {@code name} in or below the 654 directory specified by {@code path} and writes the file names to 655 the standard output. 656<p> 657 The files names written to the output are paths relative to the 658 specified {@code path} operand. 659 * <p> 660 * Note that the method returns {@code this} builder to allow for command 661 * chaining. The command itself is returned by the {@link #build()} method. 662 * See {@link Unix4jCommandBuilder class comments} for more information. 663 * 664 * @param options Options for the file search. 665 * @param path Starting point for the search in the directory hierarchy; 666 wildcards * and ? are supported; relative paths are resolved on the 667 basis of the current working directory. 668 * @param name Name pattern to match the file name after removing the path with the 669 leading directories; wildcards * and ? are supported, or full 670 regular expressions if either of the options {@code -regex (-r)} or 671 {@code -iregex (-i)} is specified. 672 * @return {@code this} builder to allow for method chaining; method 673 * chaining is used here to create command chains; adding a command 674 * to the chain usually means that the previous command <i>pipes</i> 675 * its output to the next command (the pipe symbol in unix) 676 */ 677 @Override 678 Unix4jCommandBuilder find(FindOptions options, String path, String name); 679 /** 680 * Finds all files matching the specified file {@code size} in or below 681 the user's current working directory and writes the file names to 682 the standard output. Matching files use at least {@code size} bytes 683 on disk if {@code size} is positive, or at most {@code abs(size)} 684 bytes if {@code size} is zero or negative. 685<p> 686 The files names written to the output are relative paths referring 687 to the working directory. 688 * <p> 689 * Note that the method returns {@code this} builder to allow for command 690 * chaining. The command itself is returned by the {@link #build()} method. 691 * See {@link Unix4jCommandBuilder class comments} for more information. 692 * 693 * @param options Options for the file search. 694 * @param size Consider only files using at least {@code size} bytes if {@code size} 695 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 696 or negative. 697 * @return {@code this} builder to allow for method chaining; method 698 * chaining is used here to create command chains; adding a command 699 * to the chain usually means that the previous command <i>pipes</i> 700 * its output to the next command (the pipe symbol in unix) 701 */ 702 @Override 703 Unix4jCommandBuilder find(FindOptions options, long size); 704 /** 705 * Finds all files matching the specified file {@code size} in or below 706 the directory specified by {@code path} and writes the file names 707 to the standard output. Matching files use at least {@code size} 708 bytes on disk if {@code size} is positive, or at most 709 {@code abs(size)} bytes if {@code size} is zero or negative. 710<p> 711 The files names written to the output are paths relative to the 712 specified {@code path} operand. 713 * <p> 714 * Note that the method returns {@code this} builder to allow for command 715 * chaining. The command itself is returned by the {@link #build()} method. 716 * See {@link Unix4jCommandBuilder class comments} for more information. 717 * 718 * @param options Options for the file search. 719 * @param path Starting point for the search in the directory hierarchy; 720 wildcards * and ? are supported; relative paths are resolved on the 721 basis of the current working directory. 722 * @param size Consider only files using at least {@code size} bytes if {@code size} 723 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 724 or negative. 725 * @return {@code this} builder to allow for method chaining; method 726 * chaining is used here to create command chains; adding a command 727 * to the chain usually means that the previous command <i>pipes</i> 728 * its output to the next command (the pipe symbol in unix) 729 */ 730 @Override 731 Unix4jCommandBuilder find(FindOptions options, String path, long size); 732 /** 733 * Finds all files that have been created, modified or accessed before 734 or after the specified {@code time} (depending on the given 735 {@code -time...} options). The names of the matching files found in 736 or below the user's current working directory are written to the 737 standard output. 738<p> 739 The files names written to the output are relative paths referring 740 to the working directory. 741 * <p> 742 * Note that the method returns {@code this} builder to allow for command 743 * chaining. The command itself is returned by the {@link #build()} method. 744 * See {@link Unix4jCommandBuilder class comments} for more information. 745 * 746 * @param options Options for the file search. 747 * @param time Consider only files that have been created, modified or accessed 748 before or after the specified {@code time} operand; consider the 749 {@code -time...} options for details of the comparison. 750 * @return {@code this} builder to allow for method chaining; method 751 * chaining is used here to create command chains; adding a command 752 * to the chain usually means that the previous command <i>pipes</i> 753 * its output to the next command (the pipe symbol in unix) 754 */ 755 @Override 756 Unix4jCommandBuilder find(FindOptions options, java.util.Date time); 757 /** 758 * Finds all files that have been created, modified or accessed before 759 or after the specified {@code time} (depending on the given 760 {@code -time...} options). The names of the matching files found in 761 or below the directory specified by {@code path} are written to 762 the standard output. 763<p> 764 The files names written to the output are paths relative to the 765 specified {@code path} operand. 766 * <p> 767 * Note that the method returns {@code this} builder to allow for command 768 * chaining. The command itself is returned by the {@link #build()} method. 769 * See {@link Unix4jCommandBuilder class comments} for more information. 770 * 771 * @param options Options for the file search. 772 * @param path Starting point for the search in the directory hierarchy; 773 wildcards * and ? are supported; relative paths are resolved on the 774 basis of the current working directory. 775 * @param time Consider only files that have been created, modified or accessed 776 before or after the specified {@code time} operand; consider the 777 {@code -time...} options for details of the comparison. 778 * @return {@code this} builder to allow for method chaining; method 779 * chaining is used here to create command chains; adding a command 780 * to the chain usually means that the previous command <i>pipes</i> 781 * its output to the next command (the pipe symbol in unix) 782 */ 783 @Override 784 Unix4jCommandBuilder find(FindOptions options, String path, java.util.Date time); 785 /** 786 * Finds all files matching the specified file {@code name} and 787 {@code size} in or below the user's current working directory and 788 writes the file names to the standard output. Matching files use 789 at least {@code size} bytes on disk if {@code size} is positive, or 790 at most {@code abs(size)} bytes if {@code size} is zero or negative. 791<p> 792 The files names written to the output are relative paths referring 793 to the working directory. 794 * <p> 795 * Note that the method returns {@code this} builder to allow for command 796 * chaining. The command itself is returned by the {@link #build()} method. 797 * See {@link Unix4jCommandBuilder class comments} for more information. 798 * 799 * @param options Options for the file search. 800 * @param size Consider only files using at least {@code size} bytes if {@code size} 801 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 802 or negative. 803 * @param name Name pattern to match the file name after removing the path with the 804 leading directories; wildcards * and ? are supported, or full 805 regular expressions if either of the options {@code -regex (-r)} or 806 {@code -iregex (-i)} is specified. 807 * @return {@code this} builder to allow for method chaining; method 808 * chaining is used here to create command chains; adding a command 809 * to the chain usually means that the previous command <i>pipes</i> 810 * its output to the next command (the pipe symbol in unix) 811 */ 812 @Override 813 Unix4jCommandBuilder find(FindOptions options, long size, String name); 814 /** 815 * Finds all files matching the specified file {@code name} and 816 {@code size} in or below the directory specified by {@code path} 817 and writes the file names to the standard output. Matching files 818 use at least {@code size} bytes on disk if {@code size} is positive, 819 or at most {@code abs(size)} bytes if {@code size} is zero or 820 negative. 821<p> 822 The files names written to the output are paths relative to the 823 specified {@code path} operand. 824 * <p> 825 * Note that the method returns {@code this} builder to allow for command 826 * chaining. The command itself is returned by the {@link #build()} method. 827 * See {@link Unix4jCommandBuilder class comments} for more information. 828 * 829 * @param options Options for the file search. 830 * @param path Starting point for the search in the directory hierarchy; 831 wildcards * and ? are supported; relative paths are resolved on the 832 basis of the current working directory. 833 * @param size Consider only files using at least {@code size} bytes if {@code size} 834 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 835 or negative. 836 * @param name Name pattern to match the file name after removing the path with the 837 leading directories; wildcards * and ? are supported, or full 838 regular expressions if either of the options {@code -regex (-r)} or 839 {@code -iregex (-i)} is specified. 840 * @return {@code this} builder to allow for method chaining; method 841 * chaining is used here to create command chains; adding a command 842 * to the chain usually means that the previous command <i>pipes</i> 843 * its output to the next command (the pipe symbol in unix) 844 */ 845 @Override 846 Unix4jCommandBuilder find(FindOptions options, String path, long size, String name); 847 /** 848 * Finds all files matching the given {@code name} that have been 849 created, modified or accessed before or after the specified 850 {@code time} (depending on the given {@code -time...} options). The 851 names of the matching files found in or below the user's current 852 working directory are written to the standard output. 853<p> 854 The files names written to the output are relative paths referring 855 to the working directory. 856 * <p> 857 * Note that the method returns {@code this} builder to allow for command 858 * chaining. The command itself is returned by the {@link #build()} method. 859 * See {@link Unix4jCommandBuilder class comments} for more information. 860 * 861 * @param options Options for the file search. 862 * @param time Consider only files that have been created, modified or accessed 863 before or after the specified {@code time} operand; consider the 864 {@code -time...} options for details of the comparison. 865 * @param name Name pattern to match the file name after removing the path with the 866 leading directories; wildcards * and ? are supported, or full 867 regular expressions if either of the options {@code -regex (-r)} or 868 {@code -iregex (-i)} is specified. 869 * @return {@code this} builder to allow for method chaining; method 870 * chaining is used here to create command chains; adding a command 871 * to the chain usually means that the previous command <i>pipes</i> 872 * its output to the next command (the pipe symbol in unix) 873 */ 874 @Override 875 Unix4jCommandBuilder find(FindOptions options, java.util.Date time, String name); 876 /** 877 * Finds all files matching the given {@code name} that have been 878 created, modified or accessed before or after the specified 879 {@code time} (depending on the given {@code -time...} options). The 880 names of the matching files found in or below the directory 881 specified by {@code path} are written to the standard output. 882<p> 883 The files names written to the output are paths relative to the 884 specified {@code path} operand. 885 * <p> 886 * Note that the method returns {@code this} builder to allow for command 887 * chaining. The command itself is returned by the {@link #build()} method. 888 * See {@link Unix4jCommandBuilder class comments} for more information. 889 * 890 * @param options Options for the file search. 891 * @param path Starting point for the search in the directory hierarchy; 892 wildcards * and ? are supported; relative paths are resolved on the 893 basis of the current working directory. 894 * @param time Consider only files that have been created, modified or accessed 895 before or after the specified {@code time} operand; consider the 896 {@code -time...} options for details of the comparison. 897 * @param name Name pattern to match the file name after removing the path with the 898 leading directories; wildcards * and ? are supported, or full 899 regular expressions if either of the options {@code -regex (-r)} or 900 {@code -iregex (-i)} is specified. 901 * @return {@code this} builder to allow for method chaining; method 902 * chaining is used here to create command chains; adding a command 903 * to the chain usually means that the previous command <i>pipes</i> 904 * its output to the next command (the pipe symbol in unix) 905 */ 906 @Override 907 Unix4jCommandBuilder find(FindOptions options, String path, java.util.Date time, String name); 908 /** 909 * Finds all files matching the given {@code name} and {@code size} and 910 have been created, modified or accessed before or after the specified 911 {@code time} (depending on the given {@code -time...} options). 912 <p> 913 Matching files use at least {@code size} bytes on disk if 914 {@code size} is positive, or at most {@code abs(size)} bytes if 915 {@code size} is zero or negative. The names of the matching files 916 found in or below the user's current working directory are written 917 to the standard output. 918<p> 919 The files names written to the output are relative paths referring 920 to the working directory. 921 * <p> 922 * Note that the method returns {@code this} builder to allow for command 923 * chaining. The command itself is returned by the {@link #build()} method. 924 * See {@link Unix4jCommandBuilder class comments} for more information. 925 * 926 * @param options Options for the file search. 927 * @param size Consider only files using at least {@code size} bytes if {@code size} 928 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 929 or negative. 930 * @param time Consider only files that have been created, modified or accessed 931 before or after the specified {@code time} operand; consider the 932 {@code -time...} options for details of the comparison. 933 * @param name Name pattern to match the file name after removing the path with the 934 leading directories; wildcards * and ? are supported, or full 935 regular expressions if either of the options {@code -regex (-r)} or 936 {@code -iregex (-i)} is specified. 937 * @return {@code this} builder to allow for method chaining; method 938 * chaining is used here to create command chains; adding a command 939 * to the chain usually means that the previous command <i>pipes</i> 940 * its output to the next command (the pipe symbol in unix) 941 */ 942 @Override 943 Unix4jCommandBuilder find(FindOptions options, long size, java.util.Date time, String name); 944 /** 945 * Finds all files matching the given {@code name} and {@code size} and 946 have been created, modified or accessed before or after the specified 947 {@code time} (depending on the given {@code -time...} options). 948 <p> 949 Matching files use at least {@code size} bytes on disk if 950 {@code size} is positive, or at most {@code abs(size)} bytes if 951 {@code size} is zero or negative. The names of the matching files 952 found in or below the directory specified by {@code path} are 953 written to the standard output. 954<p> 955 The files names written to the output are paths relative to the 956 specified {@code path} operand. 957 * <p> 958 * Note that the method returns {@code this} builder to allow for command 959 * chaining. The command itself is returned by the {@link #build()} method. 960 * See {@link Unix4jCommandBuilder class comments} for more information. 961 * 962 * @param options Options for the file search. 963 * @param path Starting point for the search in the directory hierarchy; 964 wildcards * and ? are supported; relative paths are resolved on the 965 basis of the current working directory. 966 * @param size Consider only files using at least {@code size} bytes if {@code size} 967 is positive, or at most {@code abs(size)} bytes if {@code size} is zero 968 or negative. 969 * @param time Consider only files that have been created, modified or accessed 970 before or after the specified {@code time} operand; consider the 971 {@code -time...} options for details of the comparison. 972 * @param name Name pattern to match the file name after removing the path with the 973 leading directories; wildcards * and ? are supported, or full 974 regular expressions if either of the options {@code -regex (-r)} or 975 {@code -iregex (-i)} is specified. 976 * @return {@code this} builder to allow for method chaining; method 977 * chaining is used here to create command chains; adding a command 978 * to the chain usually means that the previous command <i>pipes</i> 979 * its output to the next command (the pipe symbol in unix) 980 */ 981 @Override 982 Unix4jCommandBuilder find(FindOptions options, String path, long size, java.util.Date time, String name); 983 984 /* ------------------ from ------------------ */ 985 /** 986 * Uses the given string as input for the next command. If the string 987 contains line ending codes (UNIX or DOS independent from the host 988 operating system), the string is split into multiple lines. 989 * <p> 990 * Note that the method returns {@code this} builder to allow for command 991 * chaining. The command itself is returned by the {@link #build()} method. 992 * See {@link Unix4jCommandBuilder class comments} for more information. 993 * 994 * @param string the string to use as input 995 * @return {@code this} builder to allow for method chaining; method 996 * chaining is used here to create command chains; adding a command 997 * to the chain usually means that the previous command <i>pipes</i> 998 * its output to the next command (the pipe symbol in unix) 999 */ 1000 @Override 1001 Unix4jCommandBuilder fromString(String string); 1002 /** 1003 * Uses the given strings as input for the next command. Each string 1004 usually represents a single line of the input; however, if any of 1005 the strings contains line ending codes (UNIX or DOS independent from 1006 the host operating system), it is split into multiple lines. 1007 * <p> 1008 * Note that the method returns {@code this} builder to allow for command 1009 * chaining. The command itself is returned by the {@link #build()} method. 1010 * See {@link Unix4jCommandBuilder class comments} for more information. 1011 * 1012 * @param strings the input lines 1013 * @return {@code this} builder to allow for method chaining; method 1014 * chaining is used here to create command chains; adding a command 1015 * to the chain usually means that the previous command <i>pipes</i> 1016 * its output to the next command (the pipe symbol in unix) 1017 */ 1018 @Override 1019 Unix4jCommandBuilder fromStrings(String... strings); 1020 /** 1021 * Uses the strings in the specified {@code input} collection as input 1022 lines for the next command. Each string usually represents a single 1023 line of the input; however, if any of the strings contains line 1024 ending codes (UNIX or DOS independent from the host operating 1025 system), it is split into multiple lines. 1026 * <p> 1027 * Note that the method returns {@code this} builder to allow for command 1028 * chaining. The command itself is returned by the {@link #build()} method. 1029 * See {@link Unix4jCommandBuilder class comments} for more information. 1030 * 1031 * @param lines collection with input lines 1032 * @return {@code this} builder to allow for method chaining; method 1033 * chaining is used here to create command chains; adding a command 1034 * to the chain usually means that the previous command <i>pipes</i> 1035 * its output to the next command (the pipe symbol in unix) 1036 */ 1037 @Override 1038 Unix4jCommandBuilder from(java.util.Collection<? extends String> lines); 1039 /** 1040 * Redirects the contents of the given file into the next command. This 1041 is essentially equivalent to the following syntax in a unix command 1042 shell: {@code path > ...} 1043 * <p> 1044 * Note that the method returns {@code this} builder to allow for command 1045 * chaining. The command itself is returned by the {@link #build()} method. 1046 * See {@link Unix4jCommandBuilder class comments} for more information. 1047 * 1048 * @param path the file to use as input; wildcards * and ? are supported; relative 1049 paths are resolved on the basis of the current working directory. 1050 * @return {@code this} builder to allow for method chaining; method 1051 * chaining is used here to create command chains; adding a command 1052 * to the chain usually means that the previous command <i>pipes</i> 1053 * its output to the next command (the pipe symbol in unix) 1054 */ 1055 @Override 1056 Unix4jCommandBuilder fromFile(String path); 1057 /** 1058 * Redirects the contents of the given file into the next command. This 1059 is essentially equivalent to the following syntax in a unix command 1060 shell: {@code file > ...} 1061 * <p> 1062 * Note that the method returns {@code this} builder to allow for command 1063 * chaining. The command itself is returned by the {@link #build()} method. 1064 * See {@link Unix4jCommandBuilder class comments} for more information. 1065 * 1066 * @param file the file to use as input; relative paths are not resolved (use the 1067 string path argument to enable relative path resolving based on the 1068 current working directory). 1069 * @return {@code this} builder to allow for method chaining; method 1070 * chaining is used here to create command chains; adding a command 1071 * to the chain usually means that the previous command <i>pipes</i> 1072 * its output to the next command (the pipe symbol in unix) 1073 */ 1074 @Override 1075 Unix4jCommandBuilder fromFile(java.io.File file); 1076 /** 1077 * Reads from the given resource relative to the classpath and 1078 redirects the contents into the next command. The resource is 1079 usually a file or URL on the classpath. The resource is read using 1080 {@link Class#getResourceAsStream(String)}. 1081 * <p> 1082 * Note that the method returns {@code this} builder to allow for command 1083 * chaining. The command itself is returned by the {@link #build()} method. 1084 * See {@link Unix4jCommandBuilder class comments} for more information. 1085 * 1086 * @param resource a path to the file to redirect to the next command. The will need 1087 to be on the classpath. If the file is in the root directory, the 1088 filename should be prefixed with a forward slash. e.g.: 1089 {@code "/test-file.txt"} 1090 <p> 1091 If the file is in a package, then the package should be specified 1092 prefixed with a forward slash, and with each dot "." replaced with a 1093 forward slash. e.g.: 1094 {@code "/org/company/mypackage/test-file.txt"} 1095 * @return {@code this} builder to allow for method chaining; method 1096 * chaining is used here to create command chains; adding a command 1097 * to the chain usually means that the previous command <i>pipes</i> 1098 * its output to the next command (the pipe symbol in unix) 1099 */ 1100 @Override 1101 Unix4jCommandBuilder fromResource(String resource); 1102 /** 1103 * Reads from the given input stream and redirects the contents into 1104 the next command. 1105 * <p> 1106 * Note that the method returns {@code this} builder to allow for command 1107 * chaining. The command itself is returned by the {@link #build()} method. 1108 * See {@link Unix4jCommandBuilder class comments} for more information. 1109 * 1110 * @param stream the input stream to read from 1111 * @return {@code this} builder to allow for method chaining; method 1112 * chaining is used here to create command chains; adding a command 1113 * to the chain usually means that the previous command <i>pipes</i> 1114 * its output to the next command (the pipe symbol in unix) 1115 */ 1116 @Override 1117 Unix4jCommandBuilder from(java.io.InputStream stream); 1118 /** 1119 * Uses the given reader and redirects the read input into the next 1120 command. 1121 * <p> 1122 * Note that the method returns {@code this} builder to allow for command 1123 * chaining. The command itself is returned by the {@link #build()} method. 1124 * See {@link Unix4jCommandBuilder class comments} for more information. 1125 * 1126 * @param reader the reader used to read the input 1127 * @return {@code this} builder to allow for method chaining; method 1128 * chaining is used here to create command chains; adding a command 1129 * to the chain usually means that the previous command <i>pipes</i> 1130 * its output to the next command (the pipe symbol in unix) 1131 */ 1132 @Override 1133 Unix4jCommandBuilder from(java.io.Reader reader); 1134 /** 1135 * Reads from the given URL and redirects the contents into the next 1136 command. 1137 * <p> 1138 * Note that the method returns {@code this} builder to allow for command 1139 * chaining. The command itself is returned by the {@link #build()} method. 1140 * See {@link Unix4jCommandBuilder class comments} for more information. 1141 * 1142 * @param url the URL to read from 1143 * @return {@code this} builder to allow for method chaining; method 1144 * chaining is used here to create command chains; adding a command 1145 * to the chain usually means that the previous command <i>pipes</i> 1146 * its output to the next command (the pipe symbol in unix) 1147 */ 1148 @Override 1149 Unix4jCommandBuilder from(java.net.URL url); 1150 /** 1151 * Reads from the given input object and redirects the contents into 1152 the next command. 1153 * <p> 1154 * Note that the method returns {@code this} builder to allow for command 1155 * chaining. The command itself is returned by the {@link #build()} method. 1156 * See {@link Unix4jCommandBuilder class comments} for more information. 1157 * 1158 * @param input the input object to read from 1159 * @return {@code this} builder to allow for method chaining; method 1160 * chaining is used here to create command chains; adding a command 1161 * to the chain usually means that the previous command <i>pipes</i> 1162 * its output to the next command (the pipe symbol in unix) 1163 */ 1164 @Override 1165 Unix4jCommandBuilder from(org.unix4j.io.Input input); 1166 1167 /* ------------------ grep ------------------ */ 1168 /** 1169 * Filters the input lines from the standard input or the provided 1170 input files and writes the matching lines to the standard output. A 1171 line matches if it contains the given {@code "--regexp"} operand 1172 value (default operand). 1173 <p> 1174 Options can be specified by acronym (with a leading dash "-") or by 1175 long name (with two leading dashes "--"). Operands other than the 1176 default "--regexp" and "--paths" operands have to be prefixed with 1177 the operand name. 1178 * <p> 1179 * Note that the method returns {@code this} builder to allow for command 1180 * chaining. The command itself is returned by the {@link #build()} method. 1181 * See {@link Unix4jCommandBuilder class comments} for more information. 1182 * 1183 * @param args String arguments defining the options and operands for the command. 1184 Options can be specified by acronym (with a leading dash "-") or by 1185 long name (with two leading dashes "--"). Operands other than the 1186 default "--pattern" and "--paths" operands have to be prefixed with 1187 the operand name (e.g. "--files" for subsequent file operand values). 1188 * @return {@code this} builder to allow for method chaining; method 1189 * chaining is used here to create command chains; adding a command 1190 * to the chain usually means that the previous command <i>pipes</i> 1191 * its output to the next command (the pipe symbol in unix) 1192 */ 1193 @Override 1194 Unix4jCommandBuilder grep(String... args); 1195 /** 1196 * Filters the input lines from the standard input and writes the 1197 matching lines to the standard output. A line matches if it contains 1198 the given {@code regexp} using case-sensitive string comparison. 1199 * <p> 1200 * Note that the method returns {@code this} builder to allow for command 1201 * chaining. The command itself is returned by the {@link #build()} method. 1202 * See {@link Unix4jCommandBuilder class comments} for more information. 1203 * 1204 * @param regexp Lines will be printed which match the given regular expression. The 1205 {@code regexp} string is surrounded with ".*" on both sides unless 1206 the {@code --wholeLine} option is specified. If the 1207 {@code --fixedStrings} option is used, plain string comparison is 1208 used instead of regular expression matching. 1209 * @return {@code this} builder to allow for method chaining; method 1210 * chaining is used here to create command chains; adding a command 1211 * to the chain usually means that the previous command <i>pipes</i> 1212 * its output to the next command (the pipe symbol in unix) 1213 */ 1214 @Override 1215 Unix4jCommandBuilder grep(String regexp); 1216 /** 1217 * Filters the lines from the specified input files and writes the 1218 matching lines to the standard output. Every line is matched against 1219 the given {@code regexp} string using case-sensitive comparison. 1220 Line endings are not relevant for the comparison. 1221 * <p> 1222 * Note that the method returns {@code this} builder to allow for command 1223 * chaining. The command itself is returned by the {@link #build()} method. 1224 * See {@link Unix4jCommandBuilder class comments} for more information. 1225 * 1226 * @param regexp Lines will be printed which match the given regular expression. The 1227 {@code regexp} string is surrounded with ".*" on both sides unless 1228 the {@code --wholeLine} option is specified. If the 1229 {@code --fixedStrings} option is used, plain string comparison is 1230 used instead of regular expression matching. 1231 * @param files The input files to be searched for the pattern; relative paths are 1232 not resolved (use the string paths argument to enable relative path 1233 resolving based on the current working directory). 1234 * @return {@code this} builder to allow for method chaining; method 1235 * chaining is used here to create command chains; adding a command 1236 * to the chain usually means that the previous command <i>pipes</i> 1237 * its output to the next command (the pipe symbol in unix) 1238 */ 1239 @Override 1240 Unix4jCommandBuilder grep(String regexp, java.io.File... files); 1241 /** 1242 * Filters the input lines from the standard input and writes the 1243 matching lines to the standard output. Every line is matched against 1244 the given regular expression {@code pattern} using case-sensitive 1245 comparison. Line endings are not relevant for the comparison. 1246 * <p> 1247 * Note that the method returns {@code this} builder to allow for command 1248 * chaining. The command itself is returned by the {@link #build()} method. 1249 * See {@link Unix4jCommandBuilder class comments} for more information. 1250 * 1251 * @param pattern Lines will be printed which match the given pattern. 1252 * @return {@code this} builder to allow for method chaining; method 1253 * chaining is used here to create command chains; adding a command 1254 * to the chain usually means that the previous command <i>pipes</i> 1255 * its output to the next command (the pipe symbol in unix) 1256 */ 1257 @Override 1258 Unix4jCommandBuilder grep(java.util.regex.Pattern pattern); 1259 /** 1260 * Filters the lines from the specified input files and writes the 1261 matching lines to the standard output. Every line is matched against 1262 the given regular expression {@code pattern} using case-sensitive 1263 comparison. Line endings are not relevant for the comparison. 1264 * <p> 1265 * Note that the method returns {@code this} builder to allow for command 1266 * chaining. The command itself is returned by the {@link #build()} method. 1267 * See {@link Unix4jCommandBuilder class comments} for more information. 1268 * 1269 * @param pattern Lines will be printed which match the given pattern. 1270 * @param files The input files to be searched for the pattern; relative paths are 1271 not resolved (use the string paths argument to enable relative path 1272 resolving based on the current working directory). 1273 * @return {@code this} builder to allow for method chaining; method 1274 * chaining is used here to create command chains; adding a command 1275 * to the chain usually means that the previous command <i>pipes</i> 1276 * its output to the next command (the pipe symbol in unix) 1277 */ 1278 @Override 1279 Unix4jCommandBuilder grep(java.util.regex.Pattern pattern, java.io.File... files); 1280 /** 1281 * Filters the lines from the specified input files and writes the 1282 matching lines to the standard output. Every line is matched against 1283 the given regular expression {@code pattern} using case-sensitive 1284 comparison. Line endings are not relevant for the comparison. 1285 * <p> 1286 * Note that the method returns {@code this} builder to allow for command 1287 * chaining. The command itself is returned by the {@link #build()} method. 1288 * See {@link Unix4jCommandBuilder class comments} for more information. 1289 * 1290 * @param pattern Lines will be printed which match the given pattern. 1291 * @param paths Pathnames of the input files to be searched for the pattern; 1292 wildcards * and ? are supported; relative paths are resolved on the 1293 basis of the current working directory. 1294 * @return {@code this} builder to allow for method chaining; method 1295 * chaining is used here to create command chains; adding a command 1296 * to the chain usually means that the previous command <i>pipes</i> 1297 * its output to the next command (the pipe symbol in unix) 1298 */ 1299 @Override 1300 Unix4jCommandBuilder grep(java.util.regex.Pattern pattern, String... paths); 1301 /** 1302 * Filters the input lines from the standard input and writes the 1303 matching lines to the standard output. Every line is matched against 1304 the given {@code regexp} string; the exact comparison rules are 1305 defined by the specified matching {@code options}. 1306 * <p> 1307 * Note that the method returns {@code this} builder to allow for command 1308 * chaining. The command itself is returned by the {@link #build()} method. 1309 * See {@link Unix4jCommandBuilder class comments} for more information. 1310 * 1311 * @param options The options defining the types of patterns and command behavior. 1312 * @param regexp Lines will be printed which match the given regular expression. The 1313 {@code regexp} string is surrounded with ".*" on both sides unless 1314 the {@code --wholeLine} option is specified. If the 1315 {@code --fixedStrings} option is used, plain string comparison is 1316 used instead of regular expression matching. 1317 * @return {@code this} builder to allow for method chaining; method 1318 * chaining is used here to create command chains; adding a command 1319 * to the chain usually means that the previous command <i>pipes</i> 1320 * its output to the next command (the pipe symbol in unix) 1321 */ 1322 @Override 1323 Unix4jCommandBuilder grep(GrepOptions options, String regexp); 1324 /** 1325 * Filters the input lines from the standard input and writes the 1326 matching lines to the standard output. Every line is matched against 1327 the given regular expression {@code pattern}; the exact comparison 1328 rules are defined by the specified matching {@code options}. 1329 * <p> 1330 * Note that the method returns {@code this} builder to allow for command 1331 * chaining. The command itself is returned by the {@link #build()} method. 1332 * See {@link Unix4jCommandBuilder class comments} for more information. 1333 * 1334 * @param options The options defining the types of patterns and command behavior. 1335 * @param pattern Lines will be printed which match the given pattern. 1336 * @return {@code this} builder to allow for method chaining; method 1337 * chaining is used here to create command chains; adding a command 1338 * to the chain usually means that the previous command <i>pipes</i> 1339 * its output to the next command (the pipe symbol in unix) 1340 */ 1341 @Override 1342 Unix4jCommandBuilder grep(GrepOptions options, java.util.regex.Pattern pattern); 1343 /** 1344 * Filters the input lines from the specified input files and writes 1345 the matching lines to the standard output. Every line is matched 1346 against the given {@code regexp} string; the exact comparison rules 1347 are defined by the specified matching {@code options}. 1348 * <p> 1349 * Note that the method returns {@code this} builder to allow for command 1350 * chaining. The command itself is returned by the {@link #build()} method. 1351 * See {@link Unix4jCommandBuilder class comments} for more information. 1352 * 1353 * @param options The options defining the types of patterns and command behavior. 1354 * @param regexp Lines will be printed which match the given regular expression. The 1355 {@code regexp} string is surrounded with ".*" on both sides unless 1356 the {@code --wholeLine} option is specified. If the 1357 {@code --fixedStrings} option is used, plain string comparison is 1358 used instead of regular expression matching. 1359 * @param files The input files to be searched for the pattern; relative paths are 1360 not resolved (use the string paths argument to enable relative path 1361 resolving based on the current working directory). 1362 * @return {@code this} builder to allow for method chaining; method 1363 * chaining is used here to create command chains; adding a command 1364 * to the chain usually means that the previous command <i>pipes</i> 1365 * its output to the next command (the pipe symbol in unix) 1366 */ 1367 @Override 1368 Unix4jCommandBuilder grep(GrepOptions options, String regexp, java.io.File... files); 1369 /** 1370 * Filters the input lines from the specified input files and writes 1371 the matching lines to the standard output. Every line is matched 1372 against the given {@code regexp} string; the exact comparison rules 1373 are defined by the specified matching {@code options}. 1374 * <p> 1375 * Note that the method returns {@code this} builder to allow for command 1376 * chaining. The command itself is returned by the {@link #build()} method. 1377 * See {@link Unix4jCommandBuilder class comments} for more information. 1378 * 1379 * @param options The options defining the types of patterns and command behavior. 1380 * @param regexp Lines will be printed which match the given regular expression. The 1381 {@code regexp} string is surrounded with ".*" on both sides unless 1382 the {@code --wholeLine} option is specified. If the 1383 {@code --fixedStrings} option is used, plain string comparison is 1384 used instead of regular expression matching. 1385 * @param paths Pathnames of the input files to be searched for the pattern; 1386 wildcards * and ? are supported; relative paths are resolved on the 1387 basis of the current working directory. 1388 * @return {@code this} builder to allow for method chaining; method 1389 * chaining is used here to create command chains; adding a command 1390 * to the chain usually means that the previous command <i>pipes</i> 1391 * its output to the next command (the pipe symbol in unix) 1392 */ 1393 @Override 1394 Unix4jCommandBuilder grep(GrepOptions options, String regexp, String... paths); 1395 /** 1396 * Filters the input lines from the specified input files and writes 1397 the matching lines to the standard output. Every line is matched 1398 against the given regular expression {@code pattern}; the exact 1399 comparison rules are defined by the specified matching 1400 {@code options}. 1401 * <p> 1402 * Note that the method returns {@code this} builder to allow for command 1403 * chaining. The command itself is returned by the {@link #build()} method. 1404 * See {@link Unix4jCommandBuilder class comments} for more information. 1405 * 1406 * @param options The options defining the types of patterns and command behavior. 1407 * @param pattern Lines will be printed which match the given pattern. 1408 * @param files The input files to be searched for the pattern; relative paths are 1409 not resolved (use the string paths argument to enable relative path 1410 resolving based on the current working directory). 1411 * @return {@code this} builder to allow for method chaining; method 1412 * chaining is used here to create command chains; adding a command 1413 * to the chain usually means that the previous command <i>pipes</i> 1414 * its output to the next command (the pipe symbol in unix) 1415 */ 1416 @Override 1417 Unix4jCommandBuilder grep(GrepOptions options, java.util.regex.Pattern pattern, java.io.File... files); 1418 /** 1419 * Filters the input lines from the specified input files and writes 1420 the matching lines to the standard output. Every line is matched 1421 against the given regular expression {@code pattern}; the exact 1422 comparison rules are defined by the specified matching 1423 {@code options}. 1424 * <p> 1425 * Note that the method returns {@code this} builder to allow for command 1426 * chaining. The command itself is returned by the {@link #build()} method. 1427 * See {@link Unix4jCommandBuilder class comments} for more information. 1428 * 1429 * @param options The options defining the types of patterns and command behavior. 1430 * @param pattern Lines will be printed which match the given pattern. 1431 * @param paths Pathnames of the input files to be searched for the pattern; 1432 wildcards * and ? are supported; relative paths are resolved on the 1433 basis of the current working directory. 1434 * @return {@code this} builder to allow for method chaining; method 1435 * chaining is used here to create command chains; adding a command 1436 * to the chain usually means that the previous command <i>pipes</i> 1437 * its output to the next command (the pipe symbol in unix) 1438 */ 1439 @Override 1440 Unix4jCommandBuilder grep(GrepOptions options, java.util.regex.Pattern pattern, String... paths); 1441 1442 /* ------------------ head ------------------ */ 1443 /** 1444 * Reads the first 10 lines from the standard input and writes them to 1445 the standard output. 1446 * <p> 1447 * Note that the method returns {@code this} builder to allow for command 1448 * chaining. The command itself is returned by the {@link #build()} method. 1449 * See {@link Unix4jCommandBuilder class comments} for more information. 1450 * 1451 * @return {@code this} builder to allow for method chaining; method 1452 * chaining is used here to create command chains; adding a command 1453 * to the chain usually means that the previous command <i>pipes</i> 1454 * its output to the next command (the pipe symbol in unix) 1455 */ 1456 @Override 1457 Unix4jCommandBuilder head(); 1458 /** 1459 * Reads the first n lines from each of the files specified and writes 1460 them to the standard output. If more than a single file is 1461 specified, each file is preceded by a header consisting of the 1462 string {@code "==> XXX <=="} where {@code "XXX"} is the name 1463 of the file. 1464<p> 1465 Options can be specified by acronym (with a leading dash "-") or by 1466 long name (with two leading dashes "--"). Operands other than the 1467 default "--paths" operand have to be prefixed with the operand 1468 name. 1469 * <p> 1470 * Note that the method returns {@code this} builder to allow for command 1471 * chaining. The command itself is returned by the {@link #build()} method. 1472 * See {@link Unix4jCommandBuilder class comments} for more information. 1473 * 1474 * @param args String arguments defining the options and operands for the command. 1475 Options can be specified by acronym (with a leading dash "-") or by 1476 long name (with two leading dashes "--"). Operands other than the 1477 default "--paths" operand have to be prefixed with the operand 1478 name (e.g. "--count" for a subsequent count operand value). 1479 * @return {@code this} builder to allow for method chaining; method 1480 * chaining is used here to create command chains; adding a command 1481 * to the chain usually means that the previous command <i>pipes</i> 1482 * its output to the next command (the pipe symbol in unix) 1483 */ 1484 @Override 1485 Unix4jCommandBuilder head(String... args); 1486 /** 1487 * Reads the first {@code count} lines from the standard input and 1488 writes them to the standard output. 1489 * <p> 1490 * Note that the method returns {@code this} builder to allow for command 1491 * chaining. The command itself is returned by the {@link #build()} method. 1492 * See {@link Unix4jCommandBuilder class comments} for more information. 1493 * 1494 * @param count The first {@code count} lines of each input file are 1495 copied to standard output, starting from 1 (characters instead of 1496 lines if the {@code -c} option is specified). Must be a non-negative 1497 integer or an exception is thrown. If {@code count} is greater than 1498 the number number of lines (characters) in the input, the 1499 application will not error and send the whole file to the output. 1500 * @return {@code this} builder to allow for method chaining; method 1501 * chaining is used here to create command chains; adding a command 1502 * to the chain usually means that the previous command <i>pipes</i> 1503 * its output to the next command (the pipe symbol in unix) 1504 */ 1505 @Override 1506 Unix4jCommandBuilder head(long count); 1507 /** 1508 * Reads the first {@code count} lines or characters from the standard 1509 input and writes them to the standard output. 1510 * <p> 1511 * Note that the method returns {@code this} builder to allow for command 1512 * chaining. The command itself is returned by the {@link #build()} method. 1513 * See {@link Unix4jCommandBuilder class comments} for more information. 1514 * 1515 * @param options Options for the head command. 1516 * @param count The first {@code count} lines of each input file are 1517 copied to standard output, starting from 1 (characters instead of 1518 lines if the {@code -c} option is specified). Must be a non-negative 1519 integer or an exception is thrown. If {@code count} is greater than 1520 the number number of lines (characters) in the input, the 1521 application will not error and send the whole file to the output. 1522 * @return {@code this} builder to allow for method chaining; method 1523 * chaining is used here to create command chains; adding a command 1524 * to the chain usually means that the previous command <i>pipes</i> 1525 * its output to the next command (the pipe symbol in unix) 1526 */ 1527 @Override 1528 Unix4jCommandBuilder head(HeadOptions options, long count); 1529 /** 1530 * Reads the first 10 lines from each of the specified files and writes 1531 them to the standard output. If more than a single file is 1532 specified, each file is preceded by a header consisting of the 1533 string {@code "==> XXX <=="} where {@code "XXX"} is the name 1534 of the file. 1535 * <p> 1536 * Note that the method returns {@code this} builder to allow for command 1537 * chaining. The command itself is returned by the {@link #build()} method. 1538 * See {@link Unix4jCommandBuilder class comments} for more information. 1539 * 1540 * @param files The input files to be filtered; relative paths are not resolved (use 1541 the string paths argument to enable relative path resolving based on 1542 the current working directory). 1543 * @return {@code this} builder to allow for method chaining; method 1544 * chaining is used here to create command chains; adding a command 1545 * to the chain usually means that the previous command <i>pipes</i> 1546 * its output to the next command (the pipe symbol in unix) 1547 */ 1548 @Override 1549 Unix4jCommandBuilder head(java.io.File... files); 1550 /** 1551 * Reads the first {@code count} lines from each of the specified files 1552 and writes them to the standard output. If more than a single file 1553 is specified, each file is preceded by a header consisting of the 1554 string {@code "==> XXX <=="} where {@code "XXX"} is the name 1555 of the file. 1556 * <p> 1557 * Note that the method returns {@code this} builder to allow for command 1558 * chaining. The command itself is returned by the {@link #build()} method. 1559 * See {@link Unix4jCommandBuilder class comments} for more information. 1560 * 1561 * @param count The first {@code count} lines of each input file are 1562 copied to standard output, starting from 1 (characters instead of 1563 lines if the {@code -c} option is specified). Must be a non-negative 1564 integer or an exception is thrown. If {@code count} is greater than 1565 the number number of lines (characters) in the input, the 1566 application will not error and send the whole file to the output. 1567 * @param files The input files to be filtered; relative paths are not resolved (use 1568 the string paths argument to enable relative path resolving based on 1569 the current working directory). 1570 * @return {@code this} builder to allow for method chaining; method 1571 * chaining is used here to create command chains; adding a command 1572 * to the chain usually means that the previous command <i>pipes</i> 1573 * its output to the next command (the pipe symbol in unix) 1574 */ 1575 @Override 1576 Unix4jCommandBuilder head(long count, java.io.File... files); 1577 /** 1578 * Reads the first {@code count} lines from each of the specified files 1579 and writes them to the standard output. If more than a single file 1580 is specified, each file is preceded by a header consisting of the 1581 string {@code "==> XXX <=="} where {@code "XXX"} is the name 1582 of the file. 1583 * <p> 1584 * Note that the method returns {@code this} builder to allow for command 1585 * chaining. The command itself is returned by the {@link #build()} method. 1586 * See {@link Unix4jCommandBuilder class comments} for more information. 1587 * 1588 * @param count The first {@code count} lines of each input file are 1589 copied to standard output, starting from 1 (characters instead of 1590 lines if the {@code -c} option is specified). Must be a non-negative 1591 integer or an exception is thrown. If {@code count} is greater than 1592 the number number of lines (characters) in the input, the 1593 application will not error and send the whole file to the output. 1594 * @param paths Pathnames of the input files to be filtered; wildcards * and ? are 1595 supported; relative paths are resolved on the basis of the current 1596 working directory. 1597 * @return {@code this} builder to allow for method chaining; method 1598 * chaining is used here to create command chains; adding a command 1599 * to the chain usually means that the previous command <i>pipes</i> 1600 * its output to the next command (the pipe symbol in unix) 1601 */ 1602 @Override 1603 Unix4jCommandBuilder head(long count, String... paths); 1604 /** 1605 * Reads the first {@code count} lines or characters from each of the 1606 specified files and writes them to the standard output. If more than 1607 a single file is specified and the {@code -q} option is not 1608 specified, each file is preceded by a header consisting of the 1609 string {@code "==> XXX <=="} where {@code "XXX"} is the name 1610 of the file. 1611 * <p> 1612 * Note that the method returns {@code this} builder to allow for command 1613 * chaining. The command itself is returned by the {@link #build()} method. 1614 * See {@link Unix4jCommandBuilder class comments} for more information. 1615 * 1616 * @param options Options for the head command. 1617 * @param count The first {@code count} lines of each input file are 1618 copied to standard output, starting from 1 (characters instead of 1619 lines if the {@code -c} option is specified). Must be a non-negative 1620 integer or an exception is thrown. If {@code count} is greater than 1621 the number number of lines (characters) in the input, the 1622 application will not error and send the whole file to the output. 1623 * @param files The input files to be filtered; relative paths are not resolved (use 1624 the string paths argument to enable relative path resolving based on 1625 the current working directory). 1626 * @return {@code this} builder to allow for method chaining; method 1627 * chaining is used here to create command chains; adding a command 1628 * to the chain usually means that the previous command <i>pipes</i> 1629 * its output to the next command (the pipe symbol in unix) 1630 */ 1631 @Override 1632 Unix4jCommandBuilder head(HeadOptions options, long count, java.io.File... files); 1633 /** 1634 * Reads the first {@code count} lines or characters from each of the 1635 specified files and writes them to the standard output. If more than 1636 a single file is specified and the {@code -q} option is not 1637 specified, each file is preceded by a header consisting of the 1638 string {@code "==> XXX <=="} where {@code "XXX"} is the name 1639 of the file. 1640 * <p> 1641 * Note that the method returns {@code this} builder to allow for command 1642 * chaining. The command itself is returned by the {@link #build()} method. 1643 * See {@link Unix4jCommandBuilder class comments} for more information. 1644 * 1645 * @param options Options for the head command. 1646 * @param count The first {@code count} lines of each input file are 1647 copied to standard output, starting from 1 (characters instead of 1648 lines if the {@code -c} option is specified). Must be a non-negative 1649 integer or an exception is thrown. If {@code count} is greater than 1650 the number number of lines (characters) in the input, the 1651 application will not error and send the whole file to the output. 1652 * @param paths Pathnames of the input files to be filtered; wildcards * and ? are 1653 supported; relative paths are resolved on the basis of the current 1654 working directory. 1655 * @return {@code this} builder to allow for method chaining; method 1656 * chaining is used here to create command chains; adding a command 1657 * to the chain usually means that the previous command <i>pipes</i> 1658 * its output to the next command (the pipe symbol in unix) 1659 */ 1660 @Override 1661 Unix4jCommandBuilder head(HeadOptions options, long count, String... paths); 1662 1663 /* ------------------ ls ------------------ */ 1664 /** 1665 * Lists all files and directories in the user's current working 1666 directory and writes them to the output. 1667 * <p> 1668 * Note that the method returns {@code this} builder to allow for command 1669 * chaining. The command itself is returned by the {@link #build()} method. 1670 * See {@link Unix4jCommandBuilder class comments} for more information. 1671 * 1672 * @return {@code this} builder to allow for method chaining; method 1673 * chaining is used here to create command chains; adding a command 1674 * to the chain usually means that the previous command <i>pipes</i> 1675 * its output to the next command (the pipe symbol in unix) 1676 */ 1677 @Override 1678 Unix4jCommandBuilder ls(); 1679 /** 1680 * Prints the name of the specified files and lists all files contained 1681 in directories for every directory in those files. 1682 <p> 1683 Options can be specified by acronym (with a leading dash "-") or by 1684 long name (with two leading dashes "--"). Operands other than the 1685 default "--paths" operand have to be prefixed with the operand 1686 name. 1687 * <p> 1688 * Note that the method returns {@code this} builder to allow for command 1689 * chaining. The command itself is returned by the {@link #build()} method. 1690 * See {@link Unix4jCommandBuilder class comments} for more information. 1691 * 1692 * @param args String arguments defining the options and operands for the command. 1693 Options can be specified by acronym (with a leading dash "-") or by 1694 long name (with two leading dashes "--"). Operands other than the 1695 default "--paths" operand have to be prefixed with the operand 1696 name (e.g. "--count" for a subsequent count operand value). 1697 * @return {@code this} builder to allow for method chaining; method 1698 * chaining is used here to create command chains; adding a command 1699 * to the chain usually means that the previous command <i>pipes</i> 1700 * its output to the next command (the pipe symbol in unix) 1701 */ 1702 @Override 1703 Unix4jCommandBuilder ls(String... args); 1704 /** 1705 * Prints the name of the given files and lists all files contained in 1706 directories for every directory in {@code files}. 1707 * <p> 1708 * Note that the method returns {@code this} builder to allow for command 1709 * chaining. The command itself is returned by the {@link #build()} method. 1710 * See {@link Unix4jCommandBuilder class comments} for more information. 1711 * 1712 * @param files The files or directories used as starting point for the listing; 1713 relative paths are not resolved (use the string path argument to 1714 enable relative path resolving based on the current working 1715 directory). 1716 * @return {@code this} builder to allow for method chaining; method 1717 * chaining is used here to create command chains; adding a command 1718 * to the chain usually means that the previous command <i>pipes</i> 1719 * its output to the next command (the pipe symbol in unix) 1720 */ 1721 @Override 1722 Unix4jCommandBuilder ls(java.io.File... files); 1723 /** 1724 * Lists all files and directories in the user's current working 1725 directory and writes them to the output using the given options 1726 specifying the details of the output format. 1727 * <p> 1728 * Note that the method returns {@code this} builder to allow for command 1729 * chaining. The command itself is returned by the {@link #build()} method. 1730 * See {@link Unix4jCommandBuilder class comments} for more information. 1731 * 1732 * @param options The options defining the output format. 1733 * @return {@code this} builder to allow for method chaining; method 1734 * chaining is used here to create command chains; adding a command 1735 * to the chain usually means that the previous command <i>pipes</i> 1736 * its output to the next command (the pipe symbol in unix) 1737 */ 1738 @Override 1739 Unix4jCommandBuilder ls(LsOptions options); 1740 /** 1741 * Prints the name of the given files and lists all files contained in 1742 directories for every directory in {@code files}. The given options 1743 define the details of the output format. 1744 * <p> 1745 * Note that the method returns {@code this} builder to allow for command 1746 * chaining. The command itself is returned by the {@link #build()} method. 1747 * See {@link Unix4jCommandBuilder class comments} for more information. 1748 * 1749 * @param options The options defining the output format. 1750 * @param files The files or directories used as starting point for the listing; 1751 relative paths are not resolved (use the string path argument to 1752 enable relative path resolving based on the current working 1753 directory). 1754 * @return {@code this} builder to allow for method chaining; method 1755 * chaining is used here to create command chains; adding a command 1756 * to the chain usually means that the previous command <i>pipes</i> 1757 * its output to the next command (the pipe symbol in unix) 1758 */ 1759 @Override 1760 Unix4jCommandBuilder ls(LsOptions options, java.io.File... files); 1761 /** 1762 * Prints the name of the given files and lists all files contained in 1763 directories for every directory in {@code files}. The given options 1764 define the details of the output format. 1765 * <p> 1766 * Note that the method returns {@code this} builder to allow for command 1767 * chaining. The command itself is returned by the {@link #build()} method. 1768 * See {@link Unix4jCommandBuilder class comments} for more information. 1769 * 1770 * @param options The options defining the output format. 1771 * @param paths The files or directories used as starting point for the listing; 1772 wildcards * and ? are supported; relative paths are resolved on the 1773 basis of the current working directory. 1774 * @return {@code this} builder to allow for method chaining; method 1775 * chaining is used here to create command chains; adding a command 1776 * to the chain usually means that the previous command <i>pipes</i> 1777 * its output to the next command (the pipe symbol in unix) 1778 */ 1779 @Override 1780 Unix4jCommandBuilder ls(LsOptions options, String... paths); 1781 1782 /* ------------------ sed ------------------ */ 1783 /** 1784 * Executes the sed script specified by the given arguments and writes 1785 the result to the standard output. 1786 <p> 1787 Options can be specified by acronym (with a leading dash "-") or by 1788 long name (with two leading dashes "--"). Operands other than the 1789 default "--script" operand have to be prefixed with the operand name. 1790 * <p> 1791 * Note that the method returns {@code this} builder to allow for command 1792 * chaining. The command itself is returned by the {@link #build()} method. 1793 * See {@link Unix4jCommandBuilder class comments} for more information. 1794 * 1795 * @param args String arguments defining the options and operands for the command. 1796 Options can be specified by acronym (with a leading dash "-") or by 1797 long name (with two leading dashes "--"). Operands other than the 1798 default "--script" operand have to be prefixed with the operand name 1799 (e.g. "--occurrence" for subsequent occurrence indices). 1800 * @return {@code this} builder to allow for method chaining; method 1801 * chaining is used here to create command chains; adding a command 1802 * to the chain usually means that the previous command <i>pipes</i> 1803 * its output to the next command (the pipe symbol in unix) 1804 */ 1805 @Override 1806 Unix4jCommandBuilder sed(String... args); 1807 /** 1808 * Executes the given sed script, such as "s/original/replacement/g". 1809 * <p> 1810 * Note that the method returns {@code this} builder to allow for command 1811 * chaining. The command itself is returned by the {@link #build()} method. 1812 * See {@link Unix4jCommandBuilder class comments} for more information. 1813 * 1814 * @param script Sed script as one string, such as "s/original/replacement/g". 1815 * @return {@code this} builder to allow for method chaining; method 1816 * chaining is used here to create command chains; adding a command 1817 * to the chain usually means that the previous command <i>pipes</i> 1818 * its output to the next command (the pipe symbol in unix) 1819 */ 1820 @Override 1821 Unix4jCommandBuilder sed(String script); 1822 /** 1823 * Substitutes the replacement string for instances of the regexp in 1824 the matched line. 1825 <p> 1826 The characters "$0" appearing in the replacement are replaced 1827 by the line matching the regexp. The characters "$n", where n is a 1828 digit other than zero, are replaced by the text matched by the 1829 corresponding backreference expression (aka group). The special 1830 meaning of "$n" in this context can be suppressed by preceding it 1831 by a backslash. 1832<p> 1833 A line can be split by substituting a newline ('\n') into it. 1834 <p> 1835 A substitution is considered to have been performed even if the 1836 replacement string is identical to the string that it replaces. 1837 * <p> 1838 * Note that the method returns {@code this} builder to allow for command 1839 * chaining. The command itself is returned by the {@link #build()} method. 1840 * See {@link Unix4jCommandBuilder class comments} for more information. 1841 * 1842 * @param regexp Regular expression matched against a line. 1843 * @param replacement Replacement string for substitute command. The characters "$0" 1844 appearing in the replacement are replaced by the line matching 1845 the regexp. The characters "$n", where n is a digit other than zero, 1846 are replaced by the text matched by the corresponding backreference 1847 expression (aka group). The special meaning of "$n" in this context 1848 can be suppressed by preceding it by a backslash. 1849 * @return {@code this} builder to allow for method chaining; method 1850 * chaining is used here to create command chains; adding a command 1851 * to the chain usually means that the previous command <i>pipes</i> 1852 * its output to the next command (the pipe symbol in unix) 1853 */ 1854 @Override 1855 Unix4jCommandBuilder sed(String regexp, String replacement); 1856 /** 1857 * Substitutes the replacement string for instances of the regexp in 1858 the matched line. Only the given occurrences of the regexp found 1859 within the matched string are substituted. 1860<p> 1861 The characters "$0" appearing in the replacement are replaced 1862 by the line matching the regexp. The characters "$n", where n is a 1863 digit other than zero, are replaced by the text matched by the 1864 corresponding backreference expression (aka group). The special 1865 meaning of "$n" in this context can be suppressed by preceding it 1866 by a backslash. 1867<p> 1868 A line can be split by substituting a newline ('\n') into it. 1869 <p> 1870 A substitution is considered to have been performed even if the 1871 replacement string is identical to the string that it replaces. 1872 * <p> 1873 * Note that the method returns {@code this} builder to allow for command 1874 * chaining. The command itself is returned by the {@link #build()} method. 1875 * See {@link Unix4jCommandBuilder class comments} for more information. 1876 * 1877 * @param regexp Regular expression matched against a line. 1878 * @param replacement Replacement string for substitute command. The characters "$0" 1879 appearing in the replacement are replaced by the line matching 1880 the regexp. The characters "$n", where n is a digit other than zero, 1881 are replaced by the text matched by the corresponding backreference 1882 expression (aka group). The special meaning of "$n" in this context 1883 can be suppressed by preceding it by a backslash. 1884 * @param occurrence Substitute for the given occurrences only of the regexp found within 1885 the matched string; the occurrence indices are one-based. If empty 1886 or omitted, all occurrences are substituted. 1887 <p> 1888 (This operand only applies to the substitute command and is ignored 1889 by all other commands). 1890 * @return {@code this} builder to allow for method chaining; method 1891 * chaining is used here to create command chains; adding a command 1892 * to the chain usually means that the previous command <i>pipes</i> 1893 * its output to the next command (the pipe symbol in unix) 1894 */ 1895 @Override 1896 Unix4jCommandBuilder sed(String regexp, String replacement, int... occurrence); 1897 /** 1898 * Executes the sed command specified by the given options or executes 1899 the print command p if no command option has been declared. 1900 * <p> 1901 * Note that the method returns {@code this} builder to allow for command 1902 * chaining. The command itself is returned by the {@link #build()} method. 1903 * See {@link Unix4jCommandBuilder class comments} for more information. 1904 * 1905 * @param options Sed options and commands 1906 * @param regexp Regular expression matched against a line. 1907 * @return {@code this} builder to allow for method chaining; method 1908 * chaining is used here to create command chains; adding a command 1909 * to the chain usually means that the previous command <i>pipes</i> 1910 * its output to the next command (the pipe symbol in unix) 1911 */ 1912 @Override 1913 Unix4jCommandBuilder sed(SedOptions options, String regexp); 1914 /** 1915 * Executes the sed command specified by the given options or executes 1916 the substitute command s if no command option has been declared. 1917 * <p> 1918 * Note that the method returns {@code this} builder to allow for command 1919 * chaining. The command itself is returned by the {@link #build()} method. 1920 * See {@link Unix4jCommandBuilder class comments} for more information. 1921 * 1922 * @param options Sed options and commands 1923 * @param string1 Regular expression matched against a line for all commands except 1924 for command y where string1 contains the source characters for the 1925 translation. 1926 * @param string2 Replacement string for substitute command s; appended, inserted or 1927 changed text for a, i and c command; destination characters for 1928 translate command y; ignored by all other commands. 1929 <p> 1930 If string2 is a replacement string for the substitute command: the 1931 characters "$0" appearing in the replacement are replaced 1932 by the line matching the regexp; the characters "$n", where n is a 1933 digit other than zero, are replaced by the text matched by the 1934 corresponding backreference expression (aka group). The special 1935 meaning of "$n" in this context can be suppressed by preceding it 1936 by a backslash. 1937<p> 1938 (This operand only applies to the commands s, a, i, c and y and is 1939 ignored by all other commands). 1940 * @return {@code this} builder to allow for method chaining; method 1941 * chaining is used here to create command chains; adding a command 1942 * to the chain usually means that the previous command <i>pipes</i> 1943 * its output to the next command (the pipe symbol in unix) 1944 */ 1945 @Override 1946 Unix4jCommandBuilder sed(SedOptions options, String string1, String string2); 1947 /** 1948 * Executes the sed command specified by the given options or executes 1949 the substitute command s if no command option has been declared. 1950 <p> 1951 The string1 operand usually contains the regular expression matched 1952 against a line for all commands except for command y where string1 1953 contains the source characters for the translation. 1954 <p> 1955 The string2 operand contains the replacement string for the 1956 substitute command s. It contains the appended, inserted or changed 1957 text for the commands a, i and c, respectively, and the destination 1958 characters for the translate command y. All other commands ignore 1959 the string2 operand. 1960 * <p> 1961 * Note that the method returns {@code this} builder to allow for command 1962 * chaining. The command itself is returned by the {@link #build()} method. 1963 * See {@link Unix4jCommandBuilder class comments} for more information. 1964 * 1965 * @param options Sed options and commands 1966 * @param string1 Regular expression matched against a line for all commands except 1967 for command y where string1 contains the source characters for the 1968 translation. 1969 * @param string2 Replacement string for substitute command s; appended, inserted or 1970 changed text for a, i and c command; destination characters for 1971 translate command y; ignored by all other commands. 1972 <p> 1973 If string2 is a replacement string for the substitute command: the 1974 characters "$0" appearing in the replacement are replaced 1975 by the line matching the regexp; the characters "$n", where n is a 1976 digit other than zero, are replaced by the text matched by the 1977 corresponding backreference expression (aka group). The special 1978 meaning of "$n" in this context can be suppressed by preceding it 1979 by a backslash. 1980<p> 1981 (This operand only applies to the commands s, a, i, c and y and is 1982 ignored by all other commands). 1983 * @param occurrence Substitute for the given occurrences only of the regexp found within 1984 the matched string; the occurrence indices are one-based. If empty 1985 or omitted, all occurrences are substituted. 1986 <p> 1987 (This operand only applies to the substitute command and is ignored 1988 by all other commands). 1989 * @return {@code this} builder to allow for method chaining; method 1990 * chaining is used here to create command chains; adding a command 1991 * to the chain usually means that the previous command <i>pipes</i> 1992 * its output to the next command (the pipe symbol in unix) 1993 */ 1994 @Override 1995 Unix4jCommandBuilder sed(SedOptions options, String string1, String string2, int... occurrence); 1996 1997 /* ------------------ sort ------------------ */ 1998 /** 1999 * Sort the lines read from the standard input and writes the result to 2000 the standard output. 2001 <p> 2002 Comparisons are based on the entire line without line ending. The 2003 collating sequence of the current locale is used to perform the 2004 comparisons. 2005 <p> 2006 The sort algorithm used is guaranteed to be stable: lines considered 2007 equal will not be reordered as a result of the sort. 2008 * <p> 2009 * Note that the method returns {@code this} builder to allow for command 2010 * chaining. The command itself is returned by the {@link #build()} method. 2011 * See {@link Unix4jCommandBuilder class comments} for more information. 2012 * 2013 * @return {@code this} builder to allow for method chaining; method 2014 * chaining is used here to create command chains; adding a command 2015 * to the chain usually means that the previous command <i>pipes</i> 2016 * its output to the next command (the pipe symbol in unix) 2017 */ 2018 @Override 2019 Unix4jCommandBuilder sort(); 2020 /** 2021 * Sort the lines of all the specified files together and writes the 2022 result to the standard output. 2023 <p> 2024 Options can be specified by acronym (with a leading dash "-") or by 2025 long name (with two leading dashes "--"). Operands other than the 2026 default "--paths" operand have to be prefixed with the operand 2027 name. 2028 <p> 2029 The sort algorithm used is guaranteed to be stable: lines considered 2030 equal will not be reordered as a result of the sort. If two lines 2031 originate from different input files, the index of the file in the 2032 input arguments list defines the ordering of the lines. 2033 * <p> 2034 * Note that the method returns {@code this} builder to allow for command 2035 * chaining. The command itself is returned by the {@link #build()} method. 2036 * See {@link Unix4jCommandBuilder class comments} for more information. 2037 * 2038 * @param args String arguments defining the options and operands for the command. 2039 Options can be specified by acronym (with a leading dash "-") or by 2040 long name (with two leading dashes "--"). Operands other than the 2041 default "--paths" operand have to be prefixed with the operand 2042 name (e.g. "--comparator" for a subsequent comparator operand value). 2043 * @return {@code this} builder to allow for method chaining; method 2044 * chaining is used here to create command chains; adding a command 2045 * to the chain usually means that the previous command <i>pipes</i> 2046 * its output to the next command (the pipe symbol in unix) 2047 */ 2048 @Override 2049 Unix4jCommandBuilder sort(String... args); 2050 /** 2051 * Sort the lines of all the specified files together and writes the 2052 result to the standard output. 2053 <p> 2054 Comparisons are based on the entire line without line ending. The 2055 collating sequence of the current locale is used to perform the 2056 comparisons. 2057 <p> 2058 The sort algorithm used is guaranteed to be stable: lines considered 2059 equal will not be reordered as a result of the sort. If two lines 2060 originate from different input files, the index of the file in the 2061 input arguments list defines the ordering of the lines. 2062 * <p> 2063 * Note that the method returns {@code this} builder to allow for command 2064 * chaining. The command itself is returned by the {@link #build()} method. 2065 * See {@link Unix4jCommandBuilder class comments} for more information. 2066 * 2067 * @param files The files to be sorted or merged; relative paths are not resolved 2068 (use the string paths argument to enable relative path resolving 2069 based on the current working directory). 2070 * @return {@code this} builder to allow for method chaining; method 2071 * chaining is used here to create command chains; adding a command 2072 * to the chain usually means that the previous command <i>pipes</i> 2073 * its output to the next command (the pipe symbol in unix) 2074 */ 2075 @Override 2076 Unix4jCommandBuilder sort(java.io.File... files); 2077 /** 2078 * Sort the lines read from the standard input and writes the result to 2079 the standard output. 2080 <p> 2081 Line comparisons are based on the specified {@code comparator}. 2082 <p> 2083 The sort algorithm used is guaranteed to be stable: lines considered 2084 equal will not be reordered as a result of the sort. 2085 * <p> 2086 * Note that the method returns {@code this} builder to allow for command 2087 * chaining. The command itself is returned by the {@link #build()} method. 2088 * See {@link Unix4jCommandBuilder class comments} for more information. 2089 * 2090 * @param comparator The comparator to use for the line comparisons. 2091 * @return {@code this} builder to allow for method chaining; method 2092 * chaining is used here to create command chains; adding a command 2093 * to the chain usually means that the previous command <i>pipes</i> 2094 * its output to the next command (the pipe symbol in unix) 2095 */ 2096 @Override 2097 Unix4jCommandBuilder sort(java.util.Comparator<? super org.unix4j.line.Line> comparator); 2098 /** 2099 * Sort the lines of all the specified files together and writes the 2100 result to the standard output. 2101 <p> 2102 Line comparisons are based on the specified {@code comparator}. 2103 <p> 2104 The sort algorithm used is guaranteed to be stable: lines considered 2105 equal will not be reordered as a result of the sort. If two lines 2106 originate from different input files, the index of the file in the 2107 input arguments list defines the ordering of the lines. 2108 * <p> 2109 * Note that the method returns {@code this} builder to allow for command 2110 * chaining. The command itself is returned by the {@link #build()} method. 2111 * See {@link Unix4jCommandBuilder class comments} for more information. 2112 * 2113 * @param comparator The comparator to use for the line comparisons. 2114 * @param files The files to be sorted or merged; relative paths are not resolved 2115 (use the string paths argument to enable relative path resolving 2116 based on the current working directory). 2117 * @return {@code this} builder to allow for method chaining; method 2118 * chaining is used here to create command chains; adding a command 2119 * to the chain usually means that the previous command <i>pipes</i> 2120 * its output to the next command (the pipe symbol in unix) 2121 */ 2122 @Override 2123 Unix4jCommandBuilder sort(java.util.Comparator<? super org.unix4j.line.Line> comparator, java.io.File... files); 2124 /** 2125 * Sort the lines of all the specified files together and writes the 2126 result to the standard output. 2127 <p> 2128 Line comparisons are based on the specified {@code comparator}. 2129 <p> 2130 The sort algorithm used is guaranteed to be stable: lines considered 2131 equal will not be reordered as a result of the sort. If two lines 2132 originate from different input files, the index of the file in the 2133 input arguments list defines the ordering of the lines. 2134 * <p> 2135 * Note that the method returns {@code this} builder to allow for command 2136 * chaining. The command itself is returned by the {@link #build()} method. 2137 * See {@link Unix4jCommandBuilder class comments} for more information. 2138 * 2139 * @param comparator The comparator to use for the line comparisons. 2140 * @param paths Pathnames of the files to be sorted, merged, or checked; wildcards * 2141 and ? are supported; relative paths are resolved on the 2142 basis of the current working directory. 2143 * @return {@code this} builder to allow for method chaining; method 2144 * chaining is used here to create command chains; adding a command 2145 * to the chain usually means that the previous command <i>pipes</i> 2146 * its output to the next command (the pipe symbol in unix) 2147 */ 2148 @Override 2149 Unix4jCommandBuilder sort(java.util.Comparator<? super org.unix4j.line.Line> comparator, String... paths); 2150 /** 2151 * Sorts, merges, or sequence checks the lines read from the standard 2152 input and writes the result to the standard output. 2153 <p> 2154 Comparisons are based on the entire line without line ending. The 2155 collating sequence of the current locale is used to perform the 2156 comparisons. 2157 <p> 2158 The sort algorithm used is guaranteed to be stable: lines considered 2159 equal will not be reordered as a result of the sort. 2160 * <p> 2161 * Note that the method returns {@code this} builder to allow for command 2162 * chaining. The command itself is returned by the {@link #build()} method. 2163 * See {@link Unix4jCommandBuilder class comments} for more information. 2164 * 2165 * @param options The options for the sort command. 2166 * @return {@code this} builder to allow for method chaining; method 2167 * chaining is used here to create command chains; adding a command 2168 * to the chain usually means that the previous command <i>pipes</i> 2169 * its output to the next command (the pipe symbol in unix) 2170 */ 2171 @Override 2172 Unix4jCommandBuilder sort(SortOptions options); 2173 /** 2174 * Sorts, merges, or sequence checks the lines the lines of all the 2175 specified files together and writes the result to the standard 2176 output. 2177 <p> 2178 Comparisons are based on the entire line without line ending. The 2179 collating sequence of the current locale is used to perform the 2180 comparisons. 2181 <p> 2182 The sort algorithm used is guaranteed to be stable: lines considered 2183 equal will not be reordered as a result of the sort. If two lines 2184 originate from different input files, the index of the file in the 2185 input arguments list defines the ordering of the lines. 2186 * <p> 2187 * Note that the method returns {@code this} builder to allow for command 2188 * chaining. The command itself is returned by the {@link #build()} method. 2189 * See {@link Unix4jCommandBuilder class comments} for more information. 2190 * 2191 * @param options The options for the sort command. 2192 * @param files The files to be sorted or merged; relative paths are not resolved 2193 (use the string paths argument to enable relative path resolving 2194 based on the current working directory). 2195 * @return {@code this} builder to allow for method chaining; method 2196 * chaining is used here to create command chains; adding a command 2197 * to the chain usually means that the previous command <i>pipes</i> 2198 * its output to the next command (the pipe symbol in unix) 2199 */ 2200 @Override 2201 Unix4jCommandBuilder sort(SortOptions options, java.io.File... files); 2202 /** 2203 * Sorts, merges, or sequence checks the lines the lines of all the 2204 specified files together and writes the result to the standard 2205 output. 2206 <p> 2207 Comparisons are based on the entire line without line ending. The 2208 collating sequence of the current locale is used to perform the 2209 comparisons. 2210 <p> 2211 The sort algorithm used is guaranteed to be stable: lines considered 2212 equal will not be reordered as a result of the sort. If two lines 2213 originate from different input files, the index of the file in the 2214 input arguments list defines the ordering of the lines. 2215 * <p> 2216 * Note that the method returns {@code this} builder to allow for command 2217 * chaining. The command itself is returned by the {@link #build()} method. 2218 * See {@link Unix4jCommandBuilder class comments} for more information. 2219 * 2220 * @param options The options for the sort command. 2221 * @param paths Pathnames of the files to be sorted, merged, or checked; wildcards * 2222 and ? are supported; relative paths are resolved on the 2223 basis of the current working directory. 2224 * @return {@code this} builder to allow for method chaining; method 2225 * chaining is used here to create command chains; adding a command 2226 * to the chain usually means that the previous command <i>pipes</i> 2227 * its output to the next command (the pipe symbol in unix) 2228 */ 2229 @Override 2230 Unix4jCommandBuilder sort(SortOptions options, String... paths); 2231 /** 2232 * Sorts, merges, or sequence checks the lines read from the standard 2233 input and writes the result to the standard output. 2234 <p> 2235 Line comparisons are based on the specified {@code comparator}. 2236 All comparison related options are ignored except for 2237 {@code --reverse}. 2238 <p> 2239 The sort algorithm used is guaranteed to be stable: lines considered 2240 equal will not be reordered as a result of the sort. 2241 * <p> 2242 * Note that the method returns {@code this} builder to allow for command 2243 * chaining. The command itself is returned by the {@link #build()} method. 2244 * See {@link Unix4jCommandBuilder class comments} for more information. 2245 * 2246 * @param options The options for the sort command. 2247 * @param comparator The comparator to use for the line comparisons. 2248 * @return {@code this} builder to allow for method chaining; method 2249 * chaining is used here to create command chains; adding a command 2250 * to the chain usually means that the previous command <i>pipes</i> 2251 * its output to the next command (the pipe symbol in unix) 2252 */ 2253 @Override 2254 Unix4jCommandBuilder sort(SortOptions options, java.util.Comparator<? super org.unix4j.line.Line> comparator); 2255 /** 2256 * Sorts, merges, or sequence checks the lines the lines of all the 2257 specified files together and writes the result to the standard 2258 output. 2259 <p> 2260 Line comparisons are based on the specified {@code comparator}. 2261 All comparison related options except for {@code --reverse} are 2262 ignored. 2263 <p> 2264 The sort algorithm used is guaranteed to be stable: lines considered 2265 equal will not be reordered as a result of the sort. If two lines 2266 originate from different input files, the index of the file in the 2267 input arguments list defines the ordering of the lines. 2268 * <p> 2269 * Note that the method returns {@code this} builder to allow for command 2270 * chaining. The command itself is returned by the {@link #build()} method. 2271 * See {@link Unix4jCommandBuilder class comments} for more information. 2272 * 2273 * @param options The options for the sort command. 2274 * @param comparator The comparator to use for the line comparisons. 2275 * @param files The files to be sorted or merged; relative paths are not resolved 2276 (use the string paths argument to enable relative path resolving 2277 based on the current working directory). 2278 * @return {@code this} builder to allow for method chaining; method 2279 * chaining is used here to create command chains; adding a command 2280 * to the chain usually means that the previous command <i>pipes</i> 2281 * its output to the next command (the pipe symbol in unix) 2282 */ 2283 @Override 2284 Unix4jCommandBuilder sort(SortOptions options, java.util.Comparator<? super org.unix4j.line.Line> comparator, java.io.File... files); 2285 /** 2286 * Sorts, merges, or sequence checks the lines the lines of all the 2287 specified files together and writes the result to the standard 2288 output. 2289 <p> 2290 Line comparisons are based on the specified {@code comparator}. 2291 All comparison related options except for {@code --reverse} are 2292 ignored. 2293 <p> 2294 The sort algorithm used is guaranteed to be stable: lines considered 2295 equal will not be reordered as a result of the sort. If two lines 2296 originate from different input files, the index of the file in the 2297 input arguments list defines the ordering of the lines. 2298 * <p> 2299 * Note that the method returns {@code this} builder to allow for command 2300 * chaining. The command itself is returned by the {@link #build()} method. 2301 * See {@link Unix4jCommandBuilder class comments} for more information. 2302 * 2303 * @param options The options for the sort command. 2304 * @param comparator The comparator to use for the line comparisons. 2305 * @param paths Pathnames of the files to be sorted, merged, or checked; wildcards * 2306 and ? are supported; relative paths are resolved on the 2307 basis of the current working directory. 2308 * @return {@code this} builder to allow for method chaining; method 2309 * chaining is used here to create command chains; adding a command 2310 * to the chain usually means that the previous command <i>pipes</i> 2311 * its output to the next command (the pipe symbol in unix) 2312 */ 2313 @Override 2314 Unix4jCommandBuilder sort(SortOptions options, java.util.Comparator<? super org.unix4j.line.Line> comparator, String... paths); 2315 2316 /* ------------------ tail ------------------ */ 2317 /** 2318 * Reads the last 10 lines from the standard input and writes them to 2319 the standard output. 2320 * <p> 2321 * Note that the method returns {@code this} builder to allow for command 2322 * chaining. The command itself is returned by the {@link #build()} method. 2323 * See {@link Unix4jCommandBuilder class comments} for more information. 2324 * 2325 * @return {@code this} builder to allow for method chaining; method 2326 * chaining is used here to create command chains; adding a command 2327 * to the chain usually means that the previous command <i>pipes</i> 2328 * its output to the next command (the pipe symbol in unix) 2329 */ 2330 @Override 2331 Unix4jCommandBuilder tail(); 2332 /** 2333 * Reads the last n lines from each of the files specified and writes 2334 them to the standard output. If more than a single file is 2335 specified, each file is preceded by a header consisting of the 2336 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2337 of the file. 2338<p> 2339 Options can be specified by acronym (with a leading dash "-") or by 2340 long name (with two leading dashes "--"). Operands other than the 2341 default "--paths" operand have to be prefixed with the operand 2342 name. 2343 * <p> 2344 * Note that the method returns {@code this} builder to allow for command 2345 * chaining. The command itself is returned by the {@link #build()} method. 2346 * See {@link Unix4jCommandBuilder class comments} for more information. 2347 * 2348 * @param args String arguments defining the options and operands for the command. 2349 Options can be specified by acronym (with a leading dash "-") or by 2350 long name (with two leading dashes "--"). Operands other than the 2351 default "--paths" operand have to be prefixed with the operand 2352 name (e.g. "--count" for a subsequent count operand value). 2353 * @return {@code this} builder to allow for method chaining; method 2354 * chaining is used here to create command chains; adding a command 2355 * to the chain usually means that the previous command <i>pipes</i> 2356 * its output to the next command (the pipe symbol in unix) 2357 */ 2358 @Override 2359 Unix4jCommandBuilder tail(String... args); 2360 /** 2361 * Reads the last {@code count} lines from the standard input and 2362 writes them to the standard output. 2363 * <p> 2364 * Note that the method returns {@code this} builder to allow for command 2365 * chaining. The command itself is returned by the {@link #build()} method. 2366 * See {@link Unix4jCommandBuilder class comments} for more information. 2367 * 2368 * @param count The last {@code count} lines of each input file are 2369 copied to standard output, starting from 1 (characters instead of 2370 lines if the {@code -c} option is specified, and offset from start 2371 instead of end with {@code -s} option). Must be a non-negative 2372 integer or an exception is thrown. If {@code count} is greater than 2373 the number number of lines (characters) in the input, the 2374 application will not error and send the whole file to the output. 2375 * @return {@code this} builder to allow for method chaining; method 2376 * chaining is used here to create command chains; adding a command 2377 * to the chain usually means that the previous command <i>pipes</i> 2378 * its output to the next command (the pipe symbol in unix) 2379 */ 2380 @Override 2381 Unix4jCommandBuilder tail(long count); 2382 /** 2383 * Reads the last {@code count} lines or characters from the standard 2384 input and writes them to the standard output. 2385 * <p> 2386 * Note that the method returns {@code this} builder to allow for command 2387 * chaining. The command itself is returned by the {@link #build()} method. 2388 * See {@link Unix4jCommandBuilder class comments} for more information. 2389 * 2390 * @param options Options for the tail command. 2391 * @param count The last {@code count} lines of each input file are 2392 copied to standard output, starting from 1 (characters instead of 2393 lines if the {@code -c} option is specified, and offset from start 2394 instead of end with {@code -s} option). Must be a non-negative 2395 integer or an exception is thrown. If {@code count} is greater than 2396 the number number of lines (characters) in the input, the 2397 application will not error and send the whole file to the output. 2398 * @return {@code this} builder to allow for method chaining; method 2399 * chaining is used here to create command chains; adding a command 2400 * to the chain usually means that the previous command <i>pipes</i> 2401 * its output to the next command (the pipe symbol in unix) 2402 */ 2403 @Override 2404 Unix4jCommandBuilder tail(TailOptions options, long count); 2405 /** 2406 * Reads the last 10 lines from each of the specified files and writes 2407 them to the standard output. If more than a single file is 2408 specified, each file is preceded by a header consisting of the 2409 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2410 of the file. 2411 * <p> 2412 * Note that the method returns {@code this} builder to allow for command 2413 * chaining. The command itself is returned by the {@link #build()} method. 2414 * See {@link Unix4jCommandBuilder class comments} for more information. 2415 * 2416 * @param files The input files to be filtered; relative paths are not resolved (use 2417 the string paths argument to enable relative path resolving based on 2418 the current working directory). 2419 * @return {@code this} builder to allow for method chaining; method 2420 * chaining is used here to create command chains; adding a command 2421 * to the chain usually means that the previous command <i>pipes</i> 2422 * its output to the next command (the pipe symbol in unix) 2423 */ 2424 @Override 2425 Unix4jCommandBuilder tail(java.io.File... files); 2426 /** 2427 * Reads the last {@code count} lines from each of the specified files 2428 and writes them to the standard output. If more than a single file 2429 is specified, each file is preceded by a header consisting of the 2430 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2431 of the file. 2432 * <p> 2433 * Note that the method returns {@code this} builder to allow for command 2434 * chaining. The command itself is returned by the {@link #build()} method. 2435 * See {@link Unix4jCommandBuilder class comments} for more information. 2436 * 2437 * @param count The last {@code count} lines of each input file are 2438 copied to standard output, starting from 1 (characters instead of 2439 lines if the {@code -c} option is specified, and offset from start 2440 instead of end with {@code -s} option). Must be a non-negative 2441 integer or an exception is thrown. If {@code count} is greater than 2442 the number number of lines (characters) in the input, the 2443 application will not error and send the whole file to the output. 2444 * @param files The input files to be filtered; relative paths are not resolved (use 2445 the string paths argument to enable relative path resolving based on 2446 the current working directory). 2447 * @return {@code this} builder to allow for method chaining; method 2448 * chaining is used here to create command chains; adding a command 2449 * to the chain usually means that the previous command <i>pipes</i> 2450 * its output to the next command (the pipe symbol in unix) 2451 */ 2452 @Override 2453 Unix4jCommandBuilder tail(long count, java.io.File... files); 2454 /** 2455 * Reads the last {@code count} lines from each of the specified files 2456 and writes them to the standard output. If more than a single file 2457 is specified, each file is preceded by a header consisting of the 2458 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2459 of the file. 2460 * <p> 2461 * Note that the method returns {@code this} builder to allow for command 2462 * chaining. The command itself is returned by the {@link #build()} method. 2463 * See {@link Unix4jCommandBuilder class comments} for more information. 2464 * 2465 * @param count The last {@code count} lines of each input file are 2466 copied to standard output, starting from 1 (characters instead of 2467 lines if the {@code -c} option is specified, and offset from start 2468 instead of end with {@code -s} option). Must be a non-negative 2469 integer or an exception is thrown. If {@code count} is greater than 2470 the number number of lines (characters) in the input, the 2471 application will not error and send the whole file to the output. 2472 * @param paths Pathnames of the input files to be filtered; wildcards * and ? are 2473 supported; relative paths are resolved on the basis of the current 2474 working directory. 2475 * @return {@code this} builder to allow for method chaining; method 2476 * chaining is used here to create command chains; adding a command 2477 * to the chain usually means that the previous command <i>pipes</i> 2478 * its output to the next command (the pipe symbol in unix) 2479 */ 2480 @Override 2481 Unix4jCommandBuilder tail(long count, String... paths); 2482 /** 2483 * Reads the last {@code count} lines or characters from each of the 2484 specified files and writes them to the standard output. If more than 2485 a single file is specified and the {@code -q} option is not 2486 specified, each file is preceded by a header consisting of the 2487 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2488 of the file. 2489 * <p> 2490 * Note that the method returns {@code this} builder to allow for command 2491 * chaining. The command itself is returned by the {@link #build()} method. 2492 * See {@link Unix4jCommandBuilder class comments} for more information. 2493 * 2494 * @param options Options for the tail command. 2495 * @param count The last {@code count} lines of each input file are 2496 copied to standard output, starting from 1 (characters instead of 2497 lines if the {@code -c} option is specified, and offset from start 2498 instead of end with {@code -s} option). Must be a non-negative 2499 integer or an exception is thrown. If {@code count} is greater than 2500 the number number of lines (characters) in the input, the 2501 application will not error and send the whole file to the output. 2502 * @param files The input files to be filtered; relative paths are not resolved (use 2503 the string paths argument to enable relative path resolving based on 2504 the current working directory). 2505 * @return {@code this} builder to allow for method chaining; method 2506 * chaining is used here to create command chains; adding a command 2507 * to the chain usually means that the previous command <i>pipes</i> 2508 * its output to the next command (the pipe symbol in unix) 2509 */ 2510 @Override 2511 Unix4jCommandBuilder tail(TailOptions options, long count, java.io.File... files); 2512 /** 2513 * Reads the last {@code count} lines or characters from each of the 2514 specified files and writes them to the standard output. If more than 2515 a single file is specified and the {@code -q} option is not 2516 specified, each file is preceded by a header consisting of the 2517 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2518 of the file. 2519 * <p> 2520 * Note that the method returns {@code this} builder to allow for command 2521 * chaining. The command itself is returned by the {@link #build()} method. 2522 * See {@link Unix4jCommandBuilder class comments} for more information. 2523 * 2524 * @param options Options for the tail command. 2525 * @param count The last {@code count} lines of each input file are 2526 copied to standard output, starting from 1 (characters instead of 2527 lines if the {@code -c} option is specified, and offset from start 2528 instead of end with {@code -s} option). Must be a non-negative 2529 integer or an exception is thrown. If {@code count} is greater than 2530 the number number of lines (characters) in the input, the 2531 application will not error and send the whole file to the output. 2532 * @param paths Pathnames of the input files to be filtered; wildcards * and ? are 2533 supported; relative paths are resolved on the basis of the current 2534 working directory. 2535 * @return {@code this} builder to allow for method chaining; method 2536 * chaining is used here to create command chains; adding a command 2537 * to the chain usually means that the previous command <i>pipes</i> 2538 * its output to the next command (the pipe symbol in unix) 2539 */ 2540 @Override 2541 Unix4jCommandBuilder tail(TailOptions options, long count, String... paths); 2542 2543 /* ------------------ uniq ------------------ */ 2544 /** 2545 * Reads from the standard input and compares adjacent lines, writing 2546 one copy of each input line to the standard output. The second and 2547 succeeding copies of repeated adjacent input lines are not written 2548 to the output. 2549 <p> 2550 Note that repeated lines in the input are not detected if they are 2551 not adjacent (see --global or -g option); sorted input lines always 2552 result in unique output lines. 2553 * <p> 2554 * Note that the method returns {@code this} builder to allow for command 2555 * chaining. The command itself is returned by the {@link #build()} method. 2556 * See {@link Unix4jCommandBuilder class comments} for more information. 2557 * 2558 * @return {@code this} builder to allow for method chaining; method 2559 * chaining is used here to create command chains; adding a command 2560 * to the chain usually means that the previous command <i>pipes</i> 2561 * its output to the next command (the pipe symbol in unix) 2562 */ 2563 @Override 2564 Unix4jCommandBuilder uniq(); 2565 /** 2566 * Reads the file specified by the {@code "--path"} operand (the 2567 default operand) and writes only unique lines to the standard 2568 output. The second and succeeding copies of repeated input lines are 2569 not written to the output. 2570 <p> 2571 Options can be specified by acronym (with a leading dash "-") or by 2572 long name (with two leading dashes "--"). Operands other than the 2573 default "--path" operand have to be prefixed with the operand name. 2574<p> 2575 Note that repeated lines in the input are not detected if they are 2576 not adjacent unless the --global is specified (sorted input lines 2577 always result in unique output lines). 2578 * <p> 2579 * Note that the method returns {@code this} builder to allow for command 2580 * chaining. The command itself is returned by the {@link #build()} method. 2581 * See {@link Unix4jCommandBuilder class comments} for more information. 2582 * 2583 * @param args String arguments defining the options and operands for the command. 2584 Options can be specified by acronym (with a leading dash "-") or by 2585 long name (with two leading dashes "--"). Operands other than the 2586 default "--path" operand have to be prefixed with the operand 2587 name. 2588 * @return {@code this} builder to allow for method chaining; method 2589 * chaining is used here to create command chains; adding a command 2590 * to the chain usually means that the previous command <i>pipes</i> 2591 * its output to the next command (the pipe symbol in unix) 2592 */ 2593 @Override 2594 Unix4jCommandBuilder uniq(String... args); 2595 /** 2596 * Reads from the specified input {@code file} and compares adjacent 2597 lines, writing one copy of each input line to the standard output. 2598 The second and succeeding copies of repeated adjacent input lines 2599 are not written to the output. 2600 <p> 2601 Note that repeated lines in the input are not detected if they are 2602 not adjacent (see --global or -g option); sorted input lines always 2603 result in unique output lines. 2604 * <p> 2605 * Note that the method returns {@code this} builder to allow for command 2606 * chaining. The command itself is returned by the {@link #build()} method. 2607 * See {@link Unix4jCommandBuilder class comments} for more information. 2608 * 2609 * @param file The files or directories used as starting point for the listing; 2610 relative paths are not resolved (use the string path argument to 2611 enable relative path resolving based on the current working 2612 directory). 2613 * @return {@code this} builder to allow for method chaining; method 2614 * chaining is used here to create command chains; adding a command 2615 * to the chain usually means that the previous command <i>pipes</i> 2616 * its output to the next command (the pipe symbol in unix) 2617 */ 2618 @Override 2619 Unix4jCommandBuilder uniq(java.io.File file); 2620 /** 2621 * Reads the file specified by its {@code path} and compares adjacent 2622 lines, writing one copy of each input line to the standard output. 2623 The second and succeeding copies of repeated adjacent input lines 2624 are not written to the output. 2625 <p> 2626 Note that repeated lines in the input are not detected if they are 2627 not adjacent (see --global or -g option); sorted input lines always 2628 result in unique output lines. 2629 * <p> 2630 * Note that the method returns {@code this} builder to allow for command 2631 * chaining. The command itself is returned by the {@link #build()} method. 2632 * See {@link Unix4jCommandBuilder class comments} for more information. 2633 * 2634 * @param path The files or directories used as starting point for the listing; 2635 wildcards * and ? are supported; relative paths are resolved on the 2636 basis of the current working directory. 2637 * @return {@code this} builder to allow for method chaining; method 2638 * chaining is used here to create command chains; adding a command 2639 * to the chain usually means that the previous command <i>pipes</i> 2640 * its output to the next command (the pipe symbol in unix) 2641 */ 2642 @Override 2643 Unix4jCommandBuilder uniq(String path); 2644 /** 2645 * Reads from the standard input and compares adjacent lines, writing 2646 one copy of each input line to the standard output. The second and 2647 succeeding copies of repeated adjacent input lines are not written 2648 to the output. 2649 <p> 2650 Note that repeated non-adjacent lines in the input are only detected 2651 with the --global or -g option. In other words, unique output lines 2652 are guaranteed only if either (a) the --global or -g option is 2653 specified, or (b) the input lines are sorted. 2654 * <p> 2655 * Note that the method returns {@code this} builder to allow for command 2656 * chaining. The command itself is returned by the {@link #build()} method. 2657 * See {@link Unix4jCommandBuilder class comments} for more information. 2658 * 2659 * @param options The options defining the uniqueness details for the output lines. 2660 * @return {@code this} builder to allow for method chaining; method 2661 * chaining is used here to create command chains; adding a command 2662 * to the chain usually means that the previous command <i>pipes</i> 2663 * its output to the next command (the pipe symbol in unix) 2664 */ 2665 @Override 2666 Unix4jCommandBuilder uniq(UniqOptions options); 2667 /** 2668 * Reads from the specified input {@code file} and compares adjacent 2669 lines, writing one copy of each input line to the standard output. 2670 The second and succeeding copies of repeated adjacent input lines 2671 are not written to the output. 2672 <p> 2673 Note that repeated non-adjacent lines in the input are only detected 2674 with the --global or -g option. In other words, unique output lines 2675 are guaranteed only if either (a) the --global or -g option is 2676 specified, or (b) the input lines are sorted. 2677 * <p> 2678 * Note that the method returns {@code this} builder to allow for command 2679 * chaining. The command itself is returned by the {@link #build()} method. 2680 * See {@link Unix4jCommandBuilder class comments} for more information. 2681 * 2682 * @param options The options defining the uniqueness details for the output lines. 2683 * @param file The files or directories used as starting point for the listing; 2684 relative paths are not resolved (use the string path argument to 2685 enable relative path resolving based on the current working 2686 directory). 2687 * @return {@code this} builder to allow for method chaining; method 2688 * chaining is used here to create command chains; adding a command 2689 * to the chain usually means that the previous command <i>pipes</i> 2690 * its output to the next command (the pipe symbol in unix) 2691 */ 2692 @Override 2693 Unix4jCommandBuilder uniq(UniqOptions options, java.io.File file); 2694 /** 2695 * Reads the file specified by its {@code path} and compares adjacent 2696 lines, writing one copy of each input line to the standard output. 2697 The second and succeeding copies of repeated adjacent input lines 2698 are not written to the output. 2699 <p> 2700 Note that repeated non-adjacent lines in the input are only detected 2701 with the --global or -g option. In other words, unique output lines 2702 are guaranteed only if either (a) the --global or -g option is 2703 specified, or (b) the input lines are sorted. 2704 * <p> 2705 * Note that the method returns {@code this} builder to allow for command 2706 * chaining. The command itself is returned by the {@link #build()} method. 2707 * See {@link Unix4jCommandBuilder class comments} for more information. 2708 * 2709 * @param options The options defining the uniqueness details for the output lines. 2710 * @param path The files or directories used as starting point for the listing; 2711 wildcards * and ? are supported; relative paths are resolved on the 2712 basis of the current working directory. 2713 * @return {@code this} builder to allow for method chaining; method 2714 * chaining is used here to create command chains; adding a command 2715 * to the chain usually means that the previous command <i>pipes</i> 2716 * its output to the next command (the pipe symbol in unix) 2717 */ 2718 @Override 2719 Unix4jCommandBuilder uniq(UniqOptions options, String path); 2720 2721 /* ------------------ wc ------------------ */ 2722 /** 2723 * Executes a count of lines, words and chars contained in the standard 2724 input and writes them to the standard output. 2725 * <p> 2726 * Note that the method returns {@code this} builder to allow for command 2727 * chaining. The command itself is returned by the {@link #build()} method. 2728 * See {@link Unix4jCommandBuilder class comments} for more information. 2729 * 2730 * @return {@code this} builder to allow for method chaining; method 2731 * chaining is used here to create command chains; adding a command 2732 * to the chain usually means that the previous command <i>pipes</i> 2733 * its output to the next command (the pipe symbol in unix) 2734 */ 2735 @Override 2736 Unix4jCommandBuilder wc(); 2737 /** 2738 * One or several counts are executed and written to the standard 2739 output. Counts include lines, words and chars (depending on the 2740 provided options) and cumulative counts for all the files are 2741 displayed on a separate line after the output for the last file if 2742 more than one input file is specified. 2743<p> 2744 Options can be specified by acronym (with a leading dash "-") or by 2745 long name (with two leading dashes "--"). Operands other than the 2746 default "--paths" operand have to be prefixed with the operand 2747 name. 2748 * <p> 2749 * Note that the method returns {@code this} builder to allow for command 2750 * chaining. The command itself is returned by the {@link #build()} method. 2751 * See {@link Unix4jCommandBuilder class comments} for more information. 2752 * 2753 * @param args String arguments defining the options and operands for the command. 2754 Options can be specified by acronym (with a leading dash "-") or by 2755 long name (with two leading dashes "--"). Operands other than the 2756 default "--paths" operand have to be prefixed with the operand 2757 name. 2758 * @return {@code this} builder to allow for method chaining; method 2759 * chaining is used here to create command chains; adding a command 2760 * to the chain usually means that the previous command <i>pipes</i> 2761 * its output to the next command (the pipe symbol in unix) 2762 */ 2763 @Override 2764 Unix4jCommandBuilder wc(String... args); 2765 /** 2766 * Executes a count of lines, words and chars contained in each input 2767 file and writes them to the standard output. If more than one input 2768 file is specified, a line of cumulative counts for all the files is 2769 displayed on a separate line after the output for the last file. 2770 * <p> 2771 * Note that the method returns {@code this} builder to allow for command 2772 * chaining. The command itself is returned by the {@link #build()} method. 2773 * See {@link Unix4jCommandBuilder class comments} for more information. 2774 * 2775 * @param files The input files; relative paths are not resolved (use the string 2776 paths argument to enable relative path resolving based on the 2777 current working directory). 2778 * @return {@code this} builder to allow for method chaining; method 2779 * chaining is used here to create command chains; adding a command 2780 * to the chain usually means that the previous command <i>pipes</i> 2781 * its output to the next command (the pipe symbol in unix) 2782 */ 2783 @Override 2784 Unix4jCommandBuilder wc(java.io.File... files); 2785 /** 2786 * Executes a one or more counts, depending on the given options, in 2787 the standard input and writes them to the standard output. 2788 * <p> 2789 * Note that the method returns {@code this} builder to allow for command 2790 * chaining. The command itself is returned by the {@link #build()} method. 2791 * See {@link Unix4jCommandBuilder class comments} for more information. 2792 * 2793 * @param options The options defining command behavior. 2794 * @return {@code this} builder to allow for method chaining; method 2795 * chaining is used here to create command chains; adding a command 2796 * to the chain usually means that the previous command <i>pipes</i> 2797 * its output to the next command (the pipe symbol in unix) 2798 */ 2799 @Override 2800 Unix4jCommandBuilder wc(WcOptions options); 2801 /** 2802 * Executes a one or more counts, depending on the given options, in 2803 each of the given input files and writes them to the standard 2804 output. If more than one input file is specified, a line of 2805 cumulative counts for all the files is displayed on a separate line 2806 after the output for the last file. 2807 * <p> 2808 * Note that the method returns {@code this} builder to allow for command 2809 * chaining. The command itself is returned by the {@link #build()} method. 2810 * See {@link Unix4jCommandBuilder class comments} for more information. 2811 * 2812 * @param options The options defining command behavior. 2813 * @param files The input files; relative paths are not resolved (use the string 2814 paths argument to enable relative path resolving based on the 2815 current working directory). 2816 * @return {@code this} builder to allow for method chaining; method 2817 * chaining is used here to create command chains; adding a command 2818 * to the chain usually means that the previous command <i>pipes</i> 2819 * its output to the next command (the pipe symbol in unix) 2820 */ 2821 @Override 2822 Unix4jCommandBuilder wc(WcOptions options, java.io.File... files); 2823 /** 2824 * Executes a one or more counts, depending on the given options, in 2825 each of the given input files and writes them to the standard 2826 output. If more than one input file is specified, a line of 2827 cumulative counts for all the files is displayed on a separate line 2828 after the output for the last file. 2829 * <p> 2830 * Note that the method returns {@code this} builder to allow for command 2831 * chaining. The command itself is returned by the {@link #build()} method. 2832 * See {@link Unix4jCommandBuilder class comments} for more information. 2833 * 2834 * @param options The options defining command behavior. 2835 * @param paths Pathnames of the input files; wildcards * and ? are supported; 2836 relative paths are resolved on the basis of the current working 2837 directory. 2838 * @return {@code this} builder to allow for method chaining; method 2839 * chaining is used here to create command chains; adding a command 2840 * to the chain usually means that the previous command <i>pipes</i> 2841 * its output to the next command (the pipe symbol in unix) 2842 */ 2843 @Override 2844 Unix4jCommandBuilder wc(WcOptions options, String[] paths); 2845 2846 /* ------------------ xargs ------------------ */ 2847 /** 2848 * Reads items from the standard input, delimited by blanks (which can 2849 be protected with double or single quotes or a backslash) or 2850 newlines, and provides variables for the items read from the 2851 standard input. The command following after xargs is executed once 2852 for every input line; the item variables are usually passed to the 2853 invoked command as arguments. 2854 * <p> 2855 * Note that the method returns {@code this} builder to allow for command 2856 * chaining. The command itself is returned by the {@link #build()} method. 2857 * See {@link Unix4jCommandBuilder class comments} for more information. 2858 * 2859 * @return {@code this} builder to allow for method chaining; method 2860 * chaining is used here to create command chains; adding a command 2861 * to the chain usually means that the previous command <i>pipes</i> 2862 * its output to the next command (the pipe symbol in unix) 2863 */ 2864 @Override 2865 Unix4jCommandBuilder xargs(); 2866 /** 2867 * Reads items from the standard input, delimited by blanks and 2868 newlines or a specified delimiter, and provides variables for the 2869 items read from the standard input. The command following after 2870 xargs is executed once for every input line (or for multiple lines 2871 depending on the input options); the item variables are usually 2872 passed to the invoked command as arguments. 2873 <p> 2874 Options can be specified by acronym (with a leading dash "-") or by 2875 long name (with two leading dashes "--"). Operands other than the 2876 default "--maxArgs" operand have to be prefixed with the operand 2877 name. 2878 * <p> 2879 * Note that the method returns {@code this} builder to allow for command 2880 * chaining. The command itself is returned by the {@link #build()} method. 2881 * See {@link Unix4jCommandBuilder class comments} for more information. 2882 * 2883 * @param args String arguments defining the options and operands for the command. 2884 Options can be specified by acronym (with a leading dash "-") or by 2885 long name (with two leading dashes "--"). Operands other than the 2886 default "--maxArgs" operand have to be prefixed with the operand 2887 name (e.g. "--maxLines" for a subsequent line count operand value). 2888 * @return {@code this} builder to allow for method chaining; method 2889 * chaining is used here to create command chains; adding a command 2890 * to the chain usually means that the previous command <i>pipes</i> 2891 * its output to the next command (the pipe symbol in unix) 2892 */ 2893 @Override 2894 Unix4jCommandBuilder xargs(String... args); 2895 /** 2896 * Reads items from the standard input using the specified delimiter to 2897 separate items, and provides variables for the items read from the 2898 standard input. The command following after xargs is executed once 2899 for every input line; the item variables are usually passed to the 2900 invoked command as arguments. 2901 * <p> 2902 * Note that the method returns {@code this} builder to allow for command 2903 * chaining. The command itself is returned by the {@link #build()} method. 2904 * See {@link Unix4jCommandBuilder class comments} for more information. 2905 * 2906 * @param delimiter Input items are terminated by the specified characters. 2907 * @return {@code this} builder to allow for method chaining; method 2908 * chaining is used here to create command chains; adding a command 2909 * to the chain usually means that the previous command <i>pipes</i> 2910 * its output to the next command (the pipe symbol in unix) 2911 */ 2912 @Override 2913 Unix4jCommandBuilder xargs(String delimiter); 2914 /** 2915 * Reads items from the standard input, delimited by blanks (which can 2916 be protected with double or single quotes or a backslash) or 2917 newlines, and provides variables for the items read from the 2918 standard input. The command following after xargs is executed once 2919 for every {@code maxLines} nonblank input lines (or possibly fewer 2920 for the last invocation with the remaining lines at the end of the 2921 file). The item variables are usually passed to the invoked command 2922 as arguments. 2923 * <p> 2924 * Note that the method returns {@code this} builder to allow for command 2925 * chaining. The command itself is returned by the {@link #build()} method. 2926 * See {@link Unix4jCommandBuilder class comments} for more information. 2927 * 2928 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 2929 * @return {@code this} builder to allow for method chaining; method 2930 * chaining is used here to create command chains; adding a command 2931 * to the chain usually means that the previous command <i>pipes</i> 2932 * its output to the next command (the pipe symbol in unix) 2933 */ 2934 @Override 2935 Unix4jCommandBuilder xargs(long maxLines); 2936 /** 2937 * Reads items from the standard input, delimited by blanks (which can 2938 be protected with double or single quotes or a backslash) or 2939 newlines, and provides variables for the items read from the 2940 standard input. The command following after xargs is executed once 2941 for every {@code maxArgs} items read from the standard input (or 2942 possibly fewer for the last invocation with the remaining items at 2943 the end of the file). The item variables are usually passed to the 2944 invoked command as arguments. 2945 * <p> 2946 * Note that the method returns {@code this} builder to allow for command 2947 * chaining. The command itself is returned by the {@link #build()} method. 2948 * See {@link Unix4jCommandBuilder class comments} for more information. 2949 * 2950 * @param maxArgs Use at most maxArgs arguments per command invocation. 2951 * @return {@code this} builder to allow for method chaining; method 2952 * chaining is used here to create command chains; adding a command 2953 * to the chain usually means that the previous command <i>pipes</i> 2954 * its output to the next command (the pipe symbol in unix) 2955 */ 2956 @Override 2957 Unix4jCommandBuilder xargs(int maxArgs); 2958 /** 2959 * Reads items from the standard input, delimited by blanks (which can 2960 be protected with double or single quotes or a backslash) or 2961 newlines, and provides variables for the items read from the 2962 standard input. The command following after xargs is executed once 2963 for every {@code maxLines} nonblank input lines or {@code maxArgs} 2964 items (whichever occurs first). Fewer lines or items may be used for 2965 the last invocation with the remaining lines at the end of the file. 2966 The item variables are usually passed to the invoked command as 2967 arguments. 2968 * <p> 2969 * Note that the method returns {@code this} builder to allow for command 2970 * chaining. The command itself is returned by the {@link #build()} method. 2971 * See {@link Unix4jCommandBuilder class comments} for more information. 2972 * 2973 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 2974 * @param maxArgs Use at most maxArgs arguments per command invocation. 2975 * @return {@code this} builder to allow for method chaining; method 2976 * chaining is used here to create command chains; adding a command 2977 * to the chain usually means that the previous command <i>pipes</i> 2978 * its output to the next command (the pipe symbol in unix) 2979 */ 2980 @Override 2981 Unix4jCommandBuilder xargs(long maxLines, int maxArgs); 2982 /** 2983 * Reads items from the standard input using the specified delimiter to 2984 separate items, and provides variables for the items read from the 2985 standard input. The command following after xargs is executed once 2986 for every {@code maxLines} nonblank input lines (or possibly fewer 2987 for the last invocation with the remaining lines at the end of the 2988 file). The item variables are usually passed to the invoked command 2989 as arguments. 2990 * <p> 2991 * Note that the method returns {@code this} builder to allow for command 2992 * chaining. The command itself is returned by the {@link #build()} method. 2993 * See {@link Unix4jCommandBuilder class comments} for more information. 2994 * 2995 * @param delimiter Input items are terminated by the specified characters. 2996 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 2997 * @return {@code this} builder to allow for method chaining; method 2998 * chaining is used here to create command chains; adding a command 2999 * to the chain usually means that the previous command <i>pipes</i> 3000 * its output to the next command (the pipe symbol in unix) 3001 */ 3002 @Override 3003 Unix4jCommandBuilder xargs(String delimiter, long maxLines); 3004 /** 3005 * Reads items from the standard input using the specified delimiter to 3006 separate items, and provides variables for the items read from the 3007 standard input. The command following after xargs is executed once 3008 for every {@code maxArgs} items read from the standard input (or 3009 possibly fewer for the last invocation with the remaining items at 3010 the end of the file). The item variables are usually passed to the 3011 invoked command as arguments. 3012 * <p> 3013 * Note that the method returns {@code this} builder to allow for command 3014 * chaining. The command itself is returned by the {@link #build()} method. 3015 * See {@link Unix4jCommandBuilder class comments} for more information. 3016 * 3017 * @param delimiter Input items are terminated by the specified characters. 3018 * @param maxArgs Use at most maxArgs arguments per command invocation. 3019 * @return {@code this} builder to allow for method chaining; method 3020 * chaining is used here to create command chains; adding a command 3021 * to the chain usually means that the previous command <i>pipes</i> 3022 * its output to the next command (the pipe symbol in unix) 3023 */ 3024 @Override 3025 Unix4jCommandBuilder xargs(String delimiter, int maxArgs); 3026 /** 3027 * Reads items from the standard input using the specified delimiter to 3028 separate items, and provides variables for the items read from the 3029 standard input. The command following after xargs is executed once 3030 for every {@code maxLines} nonblank input lines or {@code maxArgs} 3031 items (whichever occurs first). Fewer lines or items may be used for 3032 the last invocation with the remaining lines at the end of the file. 3033 The item variables are usually passed to the invoked command as 3034 arguments. 3035 * <p> 3036 * Note that the method returns {@code this} builder to allow for command 3037 * chaining. The command itself is returned by the {@link #build()} method. 3038 * See {@link Unix4jCommandBuilder class comments} for more information. 3039 * 3040 * @param delimiter Input items are terminated by the specified characters. 3041 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3042 * @param maxArgs Use at most maxArgs arguments per command invocation. 3043 * @return {@code this} builder to allow for method chaining; method 3044 * chaining is used here to create command chains; adding a command 3045 * to the chain usually means that the previous command <i>pipes</i> 3046 * its output to the next command (the pipe symbol in unix) 3047 */ 3048 @Override 3049 Unix4jCommandBuilder xargs(String delimiter, long maxLines, int maxArgs); 3050 /** 3051 * Reads items from the standard input using the specified delimiter to 3052 separate items, and provides variables for the items read from the 3053 standard input. If the {@code eof} string occurs as a line of input, 3054 the rest of the input is ignored. The command following after xargs 3055 is executed once for every {@code maxLines} nonblank input lines or 3056 {@code maxArgs} items (whichever occurs first). Fewer lines or items 3057 may be used for the last invocation with the remaining lines at the 3058 end of the file. The item variables are usually passed to the 3059 invoked command as arguments. 3060 * <p> 3061 * Note that the method returns {@code this} builder to allow for command 3062 * chaining. The command itself is returned by the {@link #build()} method. 3063 * See {@link Unix4jCommandBuilder class comments} for more information. 3064 * 3065 * @param delimiter Input items are terminated by the specified characters. 3066 * @param eof If the end of file string occurs as a line of input, the rest of the 3067 input is ignored. 3068 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3069 * @param maxArgs Use at most maxArgs arguments per command invocation. 3070 * @return {@code this} builder to allow for method chaining; method 3071 * chaining is used here to create command chains; adding a command 3072 * to the chain usually means that the previous command <i>pipes</i> 3073 * its output to the next command (the pipe symbol in unix) 3074 */ 3075 @Override 3076 Unix4jCommandBuilder xargs(String delimiter, String eof, long maxLines, int maxArgs); 3077 /** 3078 * Reads items from the standard input, delimited by blanks (which can 3079 be protected with double or single quotes or a backslash) or 3080 newlines, and provides variables for the items read from the 3081 standard input. The command following after xargs is executed once 3082 for every input line; the item variables are usually passed to the 3083 invoked command as arguments. 3084 * <p> 3085 * Note that the method returns {@code this} builder to allow for command 3086 * chaining. The command itself is returned by the {@link #build()} method. 3087 * See {@link Unix4jCommandBuilder class comments} for more information. 3088 * 3089 * @param options The options defining command behavior. 3090 * @return {@code this} builder to allow for method chaining; method 3091 * chaining is used here to create command chains; adding a command 3092 * to the chain usually means that the previous command <i>pipes</i> 3093 * its output to the next command (the pipe symbol in unix) 3094 */ 3095 @Override 3096 Unix4jCommandBuilder xargs(XargsOptions options); 3097 /** 3098 * Reads items from the standard input using the specified delimiter to 3099 separate items, and provides variables for the items read from the 3100 standard input. The command following after xargs is executed once 3101 for every input line; the item variables are usually passed to the 3102 invoked command as arguments. 3103 * <p> 3104 * Note that the method returns {@code this} builder to allow for command 3105 * chaining. The command itself is returned by the {@link #build()} method. 3106 * See {@link Unix4jCommandBuilder class comments} for more information. 3107 * 3108 * @param options The options defining command behavior. 3109 * @param delimiter Input items are terminated by the specified characters. 3110 * @return {@code this} builder to allow for method chaining; method 3111 * chaining is used here to create command chains; adding a command 3112 * to the chain usually means that the previous command <i>pipes</i> 3113 * its output to the next command (the pipe symbol in unix) 3114 */ 3115 @Override 3116 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter); 3117 /** 3118 * Reads items from the standard input, delimited by blanks (which can 3119 be protected with double or single quotes or a backslash) or 3120 newlines, and provides variables for the items read from the 3121 standard input. The command following after xargs is executed once 3122 for every {@code maxLines} nonblank input lines (or possibly fewer 3123 for the last invocation with the remaining lines at the end of the 3124 file). The item variables are usually passed to the invoked command 3125 as arguments. 3126 * <p> 3127 * Note that the method returns {@code this} builder to allow for command 3128 * chaining. The command itself is returned by the {@link #build()} method. 3129 * See {@link Unix4jCommandBuilder class comments} for more information. 3130 * 3131 * @param options The options defining command behavior. 3132 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3133 * @return {@code this} builder to allow for method chaining; method 3134 * chaining is used here to create command chains; adding a command 3135 * to the chain usually means that the previous command <i>pipes</i> 3136 * its output to the next command (the pipe symbol in unix) 3137 */ 3138 @Override 3139 Unix4jCommandBuilder xargs(XargsOptions options, long maxLines); 3140 /** 3141 * Reads items from the standard input, delimited by blanks (which can 3142 be protected with double or single quotes or a backslash) or 3143 newlines, and provides variables for the items read from the 3144 standard input. The command following after xargs is executed once 3145 for every {@code maxArgs} items read from the standard input (or 3146 possibly fewer for the last invocation with the remaining items at 3147 the end of the file). The item variables are usually passed to the 3148 invoked command as arguments. 3149 * <p> 3150 * Note that the method returns {@code this} builder to allow for command 3151 * chaining. The command itself is returned by the {@link #build()} method. 3152 * See {@link Unix4jCommandBuilder class comments} for more information. 3153 * 3154 * @param options The options defining command behavior. 3155 * @param maxArgs Use at most maxArgs arguments per command invocation. 3156 * @return {@code this} builder to allow for method chaining; method 3157 * chaining is used here to create command chains; adding a command 3158 * to the chain usually means that the previous command <i>pipes</i> 3159 * its output to the next command (the pipe symbol in unix) 3160 */ 3161 @Override 3162 Unix4jCommandBuilder xargs(XargsOptions options, int maxArgs); 3163 /** 3164 * Reads items from the standard input, delimited by blanks (which can 3165 be protected with double or single quotes or a backslash) or 3166 newlines, and provides variables for the items read from the 3167 standard input. The command following after xargs is executed once 3168 for every {@code maxLines} nonblank input lines or {@code maxArgs} 3169 items (whichever occurs first). Fewer lines or items may be used for 3170 the last invocation with the remaining lines at the end of the file. 3171 The item variables are usually passed to the invoked command as 3172 arguments. 3173 * <p> 3174 * Note that the method returns {@code this} builder to allow for command 3175 * chaining. The command itself is returned by the {@link #build()} method. 3176 * See {@link Unix4jCommandBuilder class comments} for more information. 3177 * 3178 * @param options The options defining command behavior. 3179 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3180 * @param maxArgs Use at most maxArgs arguments per command invocation. 3181 * @return {@code this} builder to allow for method chaining; method 3182 * chaining is used here to create command chains; adding a command 3183 * to the chain usually means that the previous command <i>pipes</i> 3184 * its output to the next command (the pipe symbol in unix) 3185 */ 3186 @Override 3187 Unix4jCommandBuilder xargs(XargsOptions options, long maxLines, int maxArgs); 3188 /** 3189 * Reads items from the standard input using the specified delimiter to 3190 separate items, and provides variables for the items read from the 3191 standard input. The command following after xargs is executed once 3192 for every {@code maxLines} nonblank input lines (or possibly fewer 3193 for the last invocation with the remaining lines at the end of the 3194 file). The item variables are usually passed to the invoked command 3195 as arguments. 3196 * <p> 3197 * Note that the method returns {@code this} builder to allow for command 3198 * chaining. The command itself is returned by the {@link #build()} method. 3199 * See {@link Unix4jCommandBuilder class comments} for more information. 3200 * 3201 * @param options The options defining command behavior. 3202 * @param delimiter Input items are terminated by the specified characters. 3203 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3204 * @return {@code this} builder to allow for method chaining; method 3205 * chaining is used here to create command chains; adding a command 3206 * to the chain usually means that the previous command <i>pipes</i> 3207 * its output to the next command (the pipe symbol in unix) 3208 */ 3209 @Override 3210 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter, long maxLines); 3211 /** 3212 * Reads items from the standard input using the specified delimiter to 3213 separate items, and provides variables for the items read from the 3214 standard input. The command following after xargs is executed once 3215 for every {@code maxArgs} items read from the standard input (or 3216 possibly fewer for the last invocation with the remaining items at 3217 the end of the file). The item variables are usually passed to the 3218 invoked command as arguments. 3219 * <p> 3220 * Note that the method returns {@code this} builder to allow for command 3221 * chaining. The command itself is returned by the {@link #build()} method. 3222 * See {@link Unix4jCommandBuilder class comments} for more information. 3223 * 3224 * @param options The options defining command behavior. 3225 * @param delimiter Input items are terminated by the specified characters. 3226 * @param maxArgs Use at most maxArgs arguments per command invocation. 3227 * @return {@code this} builder to allow for method chaining; method 3228 * chaining is used here to create command chains; adding a command 3229 * to the chain usually means that the previous command <i>pipes</i> 3230 * its output to the next command (the pipe symbol in unix) 3231 */ 3232 @Override 3233 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter, int maxArgs); 3234 /** 3235 * Reads items from the standard input using the specified delimiter to 3236 separate items, and provides variables for the items read from the 3237 standard input. The command following after xargs is executed once 3238 for every {@code maxLines} nonblank input lines or {@code maxArgs} 3239 items (whichever occurs first). Fewer lines or items may be used for 3240 the last invocation with the remaining lines at the end of the file. 3241 The item variables are usually passed to the invoked command as 3242 arguments. 3243 * <p> 3244 * Note that the method returns {@code this} builder to allow for command 3245 * chaining. The command itself is returned by the {@link #build()} method. 3246 * See {@link Unix4jCommandBuilder class comments} for more information. 3247 * 3248 * @param options The options defining command behavior. 3249 * @param delimiter Input items are terminated by the specified characters. 3250 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3251 * @param maxArgs Use at most maxArgs arguments per command invocation. 3252 * @return {@code this} builder to allow for method chaining; method 3253 * chaining is used here to create command chains; adding a command 3254 * to the chain usually means that the previous command <i>pipes</i> 3255 * its output to the next command (the pipe symbol in unix) 3256 */ 3257 @Override 3258 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter, long maxLines, int maxArgs); 3259 /** 3260 * Reads items from the standard input using the specified delimiter to 3261 separate items, and provides variables for the items read from the 3262 standard input. If the {@code eof} string occurs as a line of input, 3263 the rest of the input is ignored. The command following after xargs 3264 is executed once for every {@code maxLines} nonblank input lines or 3265 {@code maxArgs} items (whichever occurs first). Fewer lines or items 3266 may be used for the last invocation with the remaining lines at the 3267 end of the file. The item variables are usually passed to the 3268 invoked command as arguments. 3269 * <p> 3270 * Note that the method returns {@code this} builder to allow for command 3271 * chaining. The command itself is returned by the {@link #build()} method. 3272 * See {@link Unix4jCommandBuilder class comments} for more information. 3273 * 3274 * @param options The options defining command behavior. 3275 * @param delimiter Input items are terminated by the specified characters. 3276 * @param eof If the end of file string occurs as a line of input, the rest of the 3277 input is ignored. 3278 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3279 * @param maxArgs Use at most maxArgs arguments per command invocation. 3280 * @return {@code this} builder to allow for method chaining; method 3281 * chaining is used here to create command chains; adding a command 3282 * to the chain usually means that the previous command <i>pipes</i> 3283 * its output to the next command (the pipe symbol in unix) 3284 */ 3285 @Override 3286 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter, String eof, long maxLines, int maxArgs); 3287 3288 //override with specialized return type 3289 @Override 3290 Unix4jCommandBuilder join(Command<?> command); 3291 3292 //override with specialized return type 3293 @Override 3294 Unix4jCommandBuilder apply(LineOperation operation); 3295 3296 //override with specialized return type 3297 @Override 3298 Unix4jCommandBuilder reset(); 3299 3300}