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 An ampersand ('&') appearing in the replacement is be replaced 1827 by the line matching the regexp. The characters "\n", where n is a 1828 digit, are replaced by the text matched by the corresponding 1829 backreference expression. The special meaning of '&' and "\n" 1830 in this context can be suppressed by preceding it by a backslash. 1831<p> 1832 A line can be split by substituting a newline ('\n') into it. 1833 <p> 1834 A substitution is considered to have been performed even if the 1835 replacement string is identical to the string that it replaces. 1836 * <p> 1837 * Note that the method returns {@code this} builder to allow for command 1838 * chaining. The command itself is returned by the {@link #build()} method. 1839 * See {@link Unix4jCommandBuilder class comments} for more information. 1840 * 1841 * @param regexp Regular expression matched against a line. 1842 * @param replacement Replacement string for substitute command. An ampersand ('&') 1843 appearing in the replacement string is replaced by the string 1844 matching the regular expression. The characters "\n", where n is a 1845 digit, are replaced by the text matched by the corresponding 1846 backreference expression. The special meaning of '&' and "\n" in 1847 this context can be suppressed by preceding it by a backslash. 1848 * @return {@code this} builder to allow for method chaining; method 1849 * chaining is used here to create command chains; adding a command 1850 * to the chain usually means that the previous command <i>pipes</i> 1851 * its output to the next command (the pipe symbol in unix) 1852 */ 1853 @Override 1854 Unix4jCommandBuilder sed(String regexp, String replacement); 1855 /** 1856 * Substitutes the replacement string for instances of the regexp in 1857 the matched line. Only the given occurrences of the regexp found 1858 within the matched string are substituted. 1859 <p> 1860 An ampersand ('&') appearing in the replacement is be replaced 1861 by the line matching the regexp. The characters "\n", where n is a 1862 digit, are replaced by the text matched by the corresponding 1863 backreference expression. The special meaning of '&' and "\n" 1864 in this context can be suppressed by preceding it by a backslash. 1865<p> 1866 A line can be split by substituting a newline ('\n') into it. 1867 <p> 1868 A substitution is considered to have been performed even if the 1869 replacement string is identical to the string that it replaces. 1870 * <p> 1871 * Note that the method returns {@code this} builder to allow for command 1872 * chaining. The command itself is returned by the {@link #build()} method. 1873 * See {@link Unix4jCommandBuilder class comments} for more information. 1874 * 1875 * @param regexp Regular expression matched against a line. 1876 * @param replacement Replacement string for substitute command. An ampersand ('&') 1877 appearing in the replacement string is replaced by the string 1878 matching the regular expression. The characters "\n", where n is a 1879 digit, are replaced by the text matched by the corresponding 1880 backreference expression. The special meaning of '&' and "\n" in 1881 this context can be suppressed by preceding it by a backslash. 1882 * @param occurrence Substitute for the given occurrences only of the regexp found within 1883 the matched string; the occurrence indices are one-based. If empty 1884 or omitted, all occurrences are substituted. 1885 <p> 1886 (This operand only applies to the substitute command and is ignored 1887 by all other commands). 1888 * @return {@code this} builder to allow for method chaining; method 1889 * chaining is used here to create command chains; adding a command 1890 * to the chain usually means that the previous command <i>pipes</i> 1891 * its output to the next command (the pipe symbol in unix) 1892 */ 1893 @Override 1894 Unix4jCommandBuilder sed(String regexp, String replacement, int... occurrence); 1895 /** 1896 * Executes the sed command specified by the given options or executes 1897 the print command p if no command option has been declared. 1898 * <p> 1899 * Note that the method returns {@code this} builder to allow for command 1900 * chaining. The command itself is returned by the {@link #build()} method. 1901 * See {@link Unix4jCommandBuilder class comments} for more information. 1902 * 1903 * @param options Sed options and commands 1904 * @param regexp Regular expression matched against a line. 1905 * @return {@code this} builder to allow for method chaining; method 1906 * chaining is used here to create command chains; adding a command 1907 * to the chain usually means that the previous command <i>pipes</i> 1908 * its output to the next command (the pipe symbol in unix) 1909 */ 1910 @Override 1911 Unix4jCommandBuilder sed(SedOptions options, String regexp); 1912 /** 1913 * Executes the sed command specified by the given options or executes 1914 the substitute command s if no command option has been declared. 1915 * <p> 1916 * Note that the method returns {@code this} builder to allow for command 1917 * chaining. The command itself is returned by the {@link #build()} method. 1918 * See {@link Unix4jCommandBuilder class comments} for more information. 1919 * 1920 * @param options Sed options and commands 1921 * @param string1 Regular expression matched against a line for all commands except 1922 for command y where string1 contains the source characters for the 1923 translation. 1924 * @param string2 Replacement string for substitute command s; appended, inserted or 1925 changed text for a, i and c command; destination characters for 1926 translate command y; ignored by all other commands. 1927 <p> 1928 If string2 is a replacement string for the substitute command: an 1929 ampersand ('&') appearing in the replacement string is replaced 1930 by the string matching the regular expression; the characters "\n", 1931 where n is a digit, are replaced by the text matched by the 1932 corresponding backreference expression. The special meaning of 1933 '&' and "\n" in this context can be suppressed by preceding it 1934 by a backslash. 1935<p> 1936 (This operand only applies to the commands s, a, i, c and y and is 1937 ignored by all other commands). 1938 * @return {@code this} builder to allow for method chaining; method 1939 * chaining is used here to create command chains; adding a command 1940 * to the chain usually means that the previous command <i>pipes</i> 1941 * its output to the next command (the pipe symbol in unix) 1942 */ 1943 @Override 1944 Unix4jCommandBuilder sed(SedOptions options, String string1, String string2); 1945 /** 1946 * Executes the sed command specified by the given options or executes 1947 the substitute command s if no command option has been declared. 1948 <p> 1949 The string1 operand usually contains the regular expression matched 1950 against a line for all commands except for command y where string1 1951 contains the source characters for the translation. 1952 <p> 1953 The string2 operand contains the replacement string for the 1954 substitute command s. It contains the appended, inserted or changed 1955 text for the commands a, i and c, respectively, and the destination 1956 characters for the translate command y. All other commands ignore 1957 the string2 operand. 1958 * <p> 1959 * Note that the method returns {@code this} builder to allow for command 1960 * chaining. The command itself is returned by the {@link #build()} method. 1961 * See {@link Unix4jCommandBuilder class comments} for more information. 1962 * 1963 * @param options Sed options and commands 1964 * @param string1 Regular expression matched against a line for all commands except 1965 for command y where string1 contains the source characters for the 1966 translation. 1967 * @param string2 Replacement string for substitute command s; appended, inserted or 1968 changed text for a, i and c command; destination characters for 1969 translate command y; ignored by all other commands. 1970 <p> 1971 If string2 is a replacement string for the substitute command: an 1972 ampersand ('&') appearing in the replacement string is replaced 1973 by the string matching the regular expression; the characters "\n", 1974 where n is a digit, are replaced by the text matched by the 1975 corresponding backreference expression. The special meaning of 1976 '&' and "\n" in this context can be suppressed by preceding it 1977 by a backslash. 1978<p> 1979 (This operand only applies to the commands s, a, i, c and y and is 1980 ignored by all other commands). 1981 * @param occurrence Substitute for the given occurrences only of the regexp found within 1982 the matched string; the occurrence indices are one-based. If empty 1983 or omitted, all occurrences are substituted. 1984 <p> 1985 (This operand only applies to the substitute command and is ignored 1986 by all other commands). 1987 * @return {@code this} builder to allow for method chaining; method 1988 * chaining is used here to create command chains; adding a command 1989 * to the chain usually means that the previous command <i>pipes</i> 1990 * its output to the next command (the pipe symbol in unix) 1991 */ 1992 @Override 1993 Unix4jCommandBuilder sed(SedOptions options, String string1, String string2, int... occurrence); 1994 1995 /* ------------------ sort ------------------ */ 1996 /** 1997 * Sort the lines read from the standard input and writes the result to 1998 the standard output. 1999 <p> 2000 Comparisons are based on the entire line without line ending. The 2001 collating sequence of the current locale is used to perform the 2002 comparisons. 2003 <p> 2004 The sort algorithm used is guaranteed to be stable: lines considered 2005 equal will not be reordered as a result of the sort. 2006 * <p> 2007 * Note that the method returns {@code this} builder to allow for command 2008 * chaining. The command itself is returned by the {@link #build()} method. 2009 * See {@link Unix4jCommandBuilder class comments} for more information. 2010 * 2011 * @return {@code this} builder to allow for method chaining; method 2012 * chaining is used here to create command chains; adding a command 2013 * to the chain usually means that the previous command <i>pipes</i> 2014 * its output to the next command (the pipe symbol in unix) 2015 */ 2016 @Override 2017 Unix4jCommandBuilder sort(); 2018 /** 2019 * Sort the lines of all the specified files together and writes the 2020 result to the standard output. 2021 <p> 2022 Options can be specified by acronym (with a leading dash "-") or by 2023 long name (with two leading dashes "--"). Operands other than the 2024 default "--paths" operand have to be prefixed with the operand 2025 name. 2026 <p> 2027 The sort algorithm used is guaranteed to be stable: lines considered 2028 equal will not be reordered as a result of the sort. If two lines 2029 originate from different input files, the index of the file in the 2030 input arguments list defines the ordering of the lines. 2031 * <p> 2032 * Note that the method returns {@code this} builder to allow for command 2033 * chaining. The command itself is returned by the {@link #build()} method. 2034 * See {@link Unix4jCommandBuilder class comments} for more information. 2035 * 2036 * @param args String arguments defining the options and operands for the command. 2037 Options can be specified by acronym (with a leading dash "-") or by 2038 long name (with two leading dashes "--"). Operands other than the 2039 default "--paths" operand have to be prefixed with the operand 2040 name (e.g. "--comparator" for a subsequent comparator operand value). 2041 * @return {@code this} builder to allow for method chaining; method 2042 * chaining is used here to create command chains; adding a command 2043 * to the chain usually means that the previous command <i>pipes</i> 2044 * its output to the next command (the pipe symbol in unix) 2045 */ 2046 @Override 2047 Unix4jCommandBuilder sort(String... args); 2048 /** 2049 * Sort the lines of all the specified files together and writes the 2050 result to the standard output. 2051 <p> 2052 Comparisons are based on the entire line without line ending. The 2053 collating sequence of the current locale is used to perform the 2054 comparisons. 2055 <p> 2056 The sort algorithm used is guaranteed to be stable: lines considered 2057 equal will not be reordered as a result of the sort. If two lines 2058 originate from different input files, the index of the file in the 2059 input arguments list defines the ordering of the lines. 2060 * <p> 2061 * Note that the method returns {@code this} builder to allow for command 2062 * chaining. The command itself is returned by the {@link #build()} method. 2063 * See {@link Unix4jCommandBuilder class comments} for more information. 2064 * 2065 * @param files The files to be sorted or merged; relative paths are not resolved 2066 (use the string paths argument to enable relative path resolving 2067 based on the current working directory). 2068 * @return {@code this} builder to allow for method chaining; method 2069 * chaining is used here to create command chains; adding a command 2070 * to the chain usually means that the previous command <i>pipes</i> 2071 * its output to the next command (the pipe symbol in unix) 2072 */ 2073 @Override 2074 Unix4jCommandBuilder sort(java.io.File... files); 2075 /** 2076 * Sort the lines read from the standard input and writes the result to 2077 the standard output. 2078 <p> 2079 Line comparisons are based on the specified {@code comparator}. 2080 <p> 2081 The sort algorithm used is guaranteed to be stable: lines considered 2082 equal will not be reordered as a result of the sort. 2083 * <p> 2084 * Note that the method returns {@code this} builder to allow for command 2085 * chaining. The command itself is returned by the {@link #build()} method. 2086 * See {@link Unix4jCommandBuilder class comments} for more information. 2087 * 2088 * @param comparator The comparator to use for the line comparisons. 2089 * @return {@code this} builder to allow for method chaining; method 2090 * chaining is used here to create command chains; adding a command 2091 * to the chain usually means that the previous command <i>pipes</i> 2092 * its output to the next command (the pipe symbol in unix) 2093 */ 2094 @Override 2095 Unix4jCommandBuilder sort(java.util.Comparator<? super org.unix4j.line.Line> comparator); 2096 /** 2097 * Sort the lines of all the specified files together and writes the 2098 result to the standard output. 2099 <p> 2100 Line comparisons are based on the specified {@code comparator}. 2101 <p> 2102 The sort algorithm used is guaranteed to be stable: lines considered 2103 equal will not be reordered as a result of the sort. If two lines 2104 originate from different input files, the index of the file in the 2105 input arguments list defines the ordering of the lines. 2106 * <p> 2107 * Note that the method returns {@code this} builder to allow for command 2108 * chaining. The command itself is returned by the {@link #build()} method. 2109 * See {@link Unix4jCommandBuilder class comments} for more information. 2110 * 2111 * @param comparator The comparator to use for the line comparisons. 2112 * @param files The files to be sorted or merged; relative paths are not resolved 2113 (use the string paths argument to enable relative path resolving 2114 based on the current working directory). 2115 * @return {@code this} builder to allow for method chaining; method 2116 * chaining is used here to create command chains; adding a command 2117 * to the chain usually means that the previous command <i>pipes</i> 2118 * its output to the next command (the pipe symbol in unix) 2119 */ 2120 @Override 2121 Unix4jCommandBuilder sort(java.util.Comparator<? super org.unix4j.line.Line> comparator, java.io.File... files); 2122 /** 2123 * Sort the lines of all the specified files together and writes the 2124 result to the standard output. 2125 <p> 2126 Line comparisons are based on the specified {@code comparator}. 2127 <p> 2128 The sort algorithm used is guaranteed to be stable: lines considered 2129 equal will not be reordered as a result of the sort. If two lines 2130 originate from different input files, the index of the file in the 2131 input arguments list defines the ordering of the lines. 2132 * <p> 2133 * Note that the method returns {@code this} builder to allow for command 2134 * chaining. The command itself is returned by the {@link #build()} method. 2135 * See {@link Unix4jCommandBuilder class comments} for more information. 2136 * 2137 * @param comparator The comparator to use for the line comparisons. 2138 * @param paths Pathnames of the files to be sorted, merged, or checked; wildcards * 2139 and ? are supported; relative paths are resolved on the 2140 basis of the current working directory. 2141 * @return {@code this} builder to allow for method chaining; method 2142 * chaining is used here to create command chains; adding a command 2143 * to the chain usually means that the previous command <i>pipes</i> 2144 * its output to the next command (the pipe symbol in unix) 2145 */ 2146 @Override 2147 Unix4jCommandBuilder sort(java.util.Comparator<? super org.unix4j.line.Line> comparator, String... paths); 2148 /** 2149 * Sorts, merges, or sequence checks the lines read from the standard 2150 input and writes the result to the standard output. 2151 <p> 2152 Comparisons are based on the entire line without line ending. The 2153 collating sequence of the current locale is used to perform the 2154 comparisons. 2155 <p> 2156 The sort algorithm used is guaranteed to be stable: lines considered 2157 equal will not be reordered as a result of the sort. 2158 * <p> 2159 * Note that the method returns {@code this} builder to allow for command 2160 * chaining. The command itself is returned by the {@link #build()} method. 2161 * See {@link Unix4jCommandBuilder class comments} for more information. 2162 * 2163 * @param options The options for the sort command. 2164 * @return {@code this} builder to allow for method chaining; method 2165 * chaining is used here to create command chains; adding a command 2166 * to the chain usually means that the previous command <i>pipes</i> 2167 * its output to the next command (the pipe symbol in unix) 2168 */ 2169 @Override 2170 Unix4jCommandBuilder sort(SortOptions options); 2171 /** 2172 * Sorts, merges, or sequence checks the lines the lines of all the 2173 specified files together and writes the result to the standard 2174 output. 2175 <p> 2176 Comparisons are based on the entire line without line ending. The 2177 collating sequence of the current locale is used to perform the 2178 comparisons. 2179 <p> 2180 The sort algorithm used is guaranteed to be stable: lines considered 2181 equal will not be reordered as a result of the sort. If two lines 2182 originate from different input files, the index of the file in the 2183 input arguments list defines the ordering of the lines. 2184 * <p> 2185 * Note that the method returns {@code this} builder to allow for command 2186 * chaining. The command itself is returned by the {@link #build()} method. 2187 * See {@link Unix4jCommandBuilder class comments} for more information. 2188 * 2189 * @param options The options for the sort command. 2190 * @param files The files to be sorted or merged; relative paths are not resolved 2191 (use the string paths argument to enable relative path resolving 2192 based on the current working directory). 2193 * @return {@code this} builder to allow for method chaining; method 2194 * chaining is used here to create command chains; adding a command 2195 * to the chain usually means that the previous command <i>pipes</i> 2196 * its output to the next command (the pipe symbol in unix) 2197 */ 2198 @Override 2199 Unix4jCommandBuilder sort(SortOptions options, java.io.File... files); 2200 /** 2201 * Sorts, merges, or sequence checks the lines the lines of all the 2202 specified files together and writes the result to the standard 2203 output. 2204 <p> 2205 Comparisons are based on the entire line without line ending. The 2206 collating sequence of the current locale is used to perform the 2207 comparisons. 2208 <p> 2209 The sort algorithm used is guaranteed to be stable: lines considered 2210 equal will not be reordered as a result of the sort. If two lines 2211 originate from different input files, the index of the file in the 2212 input arguments list defines the ordering of the lines. 2213 * <p> 2214 * Note that the method returns {@code this} builder to allow for command 2215 * chaining. The command itself is returned by the {@link #build()} method. 2216 * See {@link Unix4jCommandBuilder class comments} for more information. 2217 * 2218 * @param options The options for the sort command. 2219 * @param paths Pathnames of the files to be sorted, merged, or checked; wildcards * 2220 and ? are supported; relative paths are resolved on the 2221 basis of the current working directory. 2222 * @return {@code this} builder to allow for method chaining; method 2223 * chaining is used here to create command chains; adding a command 2224 * to the chain usually means that the previous command <i>pipes</i> 2225 * its output to the next command (the pipe symbol in unix) 2226 */ 2227 @Override 2228 Unix4jCommandBuilder sort(SortOptions options, String... paths); 2229 /** 2230 * Sorts, merges, or sequence checks the lines read from the standard 2231 input and writes the result to the standard output. 2232 <p> 2233 Line comparisons are based on the specified {@code comparator}. 2234 All comparison related options are ignored except for 2235 {@code --reverse}. 2236 <p> 2237 The sort algorithm used is guaranteed to be stable: lines considered 2238 equal will not be reordered as a result of the sort. 2239 * <p> 2240 * Note that the method returns {@code this} builder to allow for command 2241 * chaining. The command itself is returned by the {@link #build()} method. 2242 * See {@link Unix4jCommandBuilder class comments} for more information. 2243 * 2244 * @param options The options for the sort command. 2245 * @param comparator The comparator to use for the line comparisons. 2246 * @return {@code this} builder to allow for method chaining; method 2247 * chaining is used here to create command chains; adding a command 2248 * to the chain usually means that the previous command <i>pipes</i> 2249 * its output to the next command (the pipe symbol in unix) 2250 */ 2251 @Override 2252 Unix4jCommandBuilder sort(SortOptions options, java.util.Comparator<? super org.unix4j.line.Line> comparator); 2253 /** 2254 * Sorts, merges, or sequence checks the lines the lines of all the 2255 specified files together and writes the result to the standard 2256 output. 2257 <p> 2258 Line comparisons are based on the specified {@code comparator}. 2259 All comparison related options except for {@code --reverse} are 2260 ignored. 2261 <p> 2262 The sort algorithm used is guaranteed to be stable: lines considered 2263 equal will not be reordered as a result of the sort. If two lines 2264 originate from different input files, the index of the file in the 2265 input arguments list defines the ordering of the lines. 2266 * <p> 2267 * Note that the method returns {@code this} builder to allow for command 2268 * chaining. The command itself is returned by the {@link #build()} method. 2269 * See {@link Unix4jCommandBuilder class comments} for more information. 2270 * 2271 * @param options The options for the sort command. 2272 * @param comparator The comparator to use for the line comparisons. 2273 * @param files The files to be sorted or merged; relative paths are not resolved 2274 (use the string paths argument to enable relative path resolving 2275 based on the current working directory). 2276 * @return {@code this} builder to allow for method chaining; method 2277 * chaining is used here to create command chains; adding a command 2278 * to the chain usually means that the previous command <i>pipes</i> 2279 * its output to the next command (the pipe symbol in unix) 2280 */ 2281 @Override 2282 Unix4jCommandBuilder sort(SortOptions options, java.util.Comparator<? super org.unix4j.line.Line> comparator, java.io.File... files); 2283 /** 2284 * Sorts, merges, or sequence checks the lines the lines of all the 2285 specified files together and writes the result to the standard 2286 output. 2287 <p> 2288 Line comparisons are based on the specified {@code comparator}. 2289 All comparison related options except for {@code --reverse} are 2290 ignored. 2291 <p> 2292 The sort algorithm used is guaranteed to be stable: lines considered 2293 equal will not be reordered as a result of the sort. If two lines 2294 originate from different input files, the index of the file in the 2295 input arguments list defines the ordering of the lines. 2296 * <p> 2297 * Note that the method returns {@code this} builder to allow for command 2298 * chaining. The command itself is returned by the {@link #build()} method. 2299 * See {@link Unix4jCommandBuilder class comments} for more information. 2300 * 2301 * @param options The options for the sort command. 2302 * @param comparator The comparator to use for the line comparisons. 2303 * @param paths Pathnames of the files to be sorted, merged, or checked; wildcards * 2304 and ? are supported; relative paths are resolved on the 2305 basis of the current working directory. 2306 * @return {@code this} builder to allow for method chaining; method 2307 * chaining is used here to create command chains; adding a command 2308 * to the chain usually means that the previous command <i>pipes</i> 2309 * its output to the next command (the pipe symbol in unix) 2310 */ 2311 @Override 2312 Unix4jCommandBuilder sort(SortOptions options, java.util.Comparator<? super org.unix4j.line.Line> comparator, String... paths); 2313 2314 /* ------------------ tail ------------------ */ 2315 /** 2316 * Reads the last 10 lines from the standard input and writes them to 2317 the standard output. 2318 * <p> 2319 * Note that the method returns {@code this} builder to allow for command 2320 * chaining. The command itself is returned by the {@link #build()} method. 2321 * See {@link Unix4jCommandBuilder class comments} for more information. 2322 * 2323 * @return {@code this} builder to allow for method chaining; method 2324 * chaining is used here to create command chains; adding a command 2325 * to the chain usually means that the previous command <i>pipes</i> 2326 * its output to the next command (the pipe symbol in unix) 2327 */ 2328 @Override 2329 Unix4jCommandBuilder tail(); 2330 /** 2331 * Reads the last n lines from each of the files specified and writes 2332 them to the standard output. If more than a single file is 2333 specified, each file is preceded by a header consisting of the 2334 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2335 of the file. 2336<p> 2337 Options can be specified by acronym (with a leading dash "-") or by 2338 long name (with two leading dashes "--"). Operands other than the 2339 default "--paths" operand have to be prefixed with the operand 2340 name. 2341 * <p> 2342 * Note that the method returns {@code this} builder to allow for command 2343 * chaining. The command itself is returned by the {@link #build()} method. 2344 * See {@link Unix4jCommandBuilder class comments} for more information. 2345 * 2346 * @param args String arguments defining the options and operands for the command. 2347 Options can be specified by acronym (with a leading dash "-") or by 2348 long name (with two leading dashes "--"). Operands other than the 2349 default "--paths" operand have to be prefixed with the operand 2350 name (e.g. "--count" for a subsequent count operand value). 2351 * @return {@code this} builder to allow for method chaining; method 2352 * chaining is used here to create command chains; adding a command 2353 * to the chain usually means that the previous command <i>pipes</i> 2354 * its output to the next command (the pipe symbol in unix) 2355 */ 2356 @Override 2357 Unix4jCommandBuilder tail(String... args); 2358 /** 2359 * Reads the last {@code count} lines from the standard input and 2360 writes them to the standard output. 2361 * <p> 2362 * Note that the method returns {@code this} builder to allow for command 2363 * chaining. The command itself is returned by the {@link #build()} method. 2364 * See {@link Unix4jCommandBuilder class comments} for more information. 2365 * 2366 * @param count The last {@code count} lines of each input file are 2367 copied to standard output, starting from 1 (characters instead of 2368 lines if the {@code -c} option is specified, and offset from start 2369 instead of end with {@code -s} option). Must be a non-negative 2370 integer or an exception is thrown. If {@code count} is greater than 2371 the number number of lines (characters) in the input, the 2372 application will not error and send the whole file to the output. 2373 * @return {@code this} builder to allow for method chaining; method 2374 * chaining is used here to create command chains; adding a command 2375 * to the chain usually means that the previous command <i>pipes</i> 2376 * its output to the next command (the pipe symbol in unix) 2377 */ 2378 @Override 2379 Unix4jCommandBuilder tail(long count); 2380 /** 2381 * Reads the last {@code count} lines or characters from the standard 2382 input and writes them to the standard output. 2383 * <p> 2384 * Note that the method returns {@code this} builder to allow for command 2385 * chaining. The command itself is returned by the {@link #build()} method. 2386 * See {@link Unix4jCommandBuilder class comments} for more information. 2387 * 2388 * @param options Options for the tail command. 2389 * @param count The last {@code count} lines of each input file are 2390 copied to standard output, starting from 1 (characters instead of 2391 lines if the {@code -c} option is specified, and offset from start 2392 instead of end with {@code -s} option). Must be a non-negative 2393 integer or an exception is thrown. If {@code count} is greater than 2394 the number number of lines (characters) in the input, the 2395 application will not error and send the whole file to the output. 2396 * @return {@code this} builder to allow for method chaining; method 2397 * chaining is used here to create command chains; adding a command 2398 * to the chain usually means that the previous command <i>pipes</i> 2399 * its output to the next command (the pipe symbol in unix) 2400 */ 2401 @Override 2402 Unix4jCommandBuilder tail(TailOptions options, long count); 2403 /** 2404 * Reads the last 10 lines from each of the specified files and writes 2405 them to the standard output. If more than a single file is 2406 specified, each file is preceded by a header consisting of the 2407 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2408 of the file. 2409 * <p> 2410 * Note that the method returns {@code this} builder to allow for command 2411 * chaining. The command itself is returned by the {@link #build()} method. 2412 * See {@link Unix4jCommandBuilder class comments} for more information. 2413 * 2414 * @param files The input files to be filtered; relative paths are not resolved (use 2415 the string paths argument to enable relative path resolving based on 2416 the current working directory). 2417 * @return {@code this} builder to allow for method chaining; method 2418 * chaining is used here to create command chains; adding a command 2419 * to the chain usually means that the previous command <i>pipes</i> 2420 * its output to the next command (the pipe symbol in unix) 2421 */ 2422 @Override 2423 Unix4jCommandBuilder tail(java.io.File... files); 2424 /** 2425 * Reads the last {@code count} lines from each of the specified files 2426 and writes them to the standard output. If more than a single file 2427 is specified, each file is preceded by a header consisting of the 2428 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2429 of the file. 2430 * <p> 2431 * Note that the method returns {@code this} builder to allow for command 2432 * chaining. The command itself is returned by the {@link #build()} method. 2433 * See {@link Unix4jCommandBuilder class comments} for more information. 2434 * 2435 * @param count The last {@code count} lines of each input file are 2436 copied to standard output, starting from 1 (characters instead of 2437 lines if the {@code -c} option is specified, and offset from start 2438 instead of end with {@code -s} option). Must be a non-negative 2439 integer or an exception is thrown. If {@code count} is greater than 2440 the number number of lines (characters) in the input, the 2441 application will not error and send the whole file to the output. 2442 * @param files The input files to be filtered; relative paths are not resolved (use 2443 the string paths argument to enable relative path resolving based on 2444 the current working directory). 2445 * @return {@code this} builder to allow for method chaining; method 2446 * chaining is used here to create command chains; adding a command 2447 * to the chain usually means that the previous command <i>pipes</i> 2448 * its output to the next command (the pipe symbol in unix) 2449 */ 2450 @Override 2451 Unix4jCommandBuilder tail(long count, java.io.File... files); 2452 /** 2453 * Reads the last {@code count} lines from each of the specified files 2454 and writes them to the standard output. If more than a single file 2455 is specified, each file is preceded by a header consisting of the 2456 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2457 of the file. 2458 * <p> 2459 * Note that the method returns {@code this} builder to allow for command 2460 * chaining. The command itself is returned by the {@link #build()} method. 2461 * See {@link Unix4jCommandBuilder class comments} for more information. 2462 * 2463 * @param count The last {@code count} lines of each input file are 2464 copied to standard output, starting from 1 (characters instead of 2465 lines if the {@code -c} option is specified, and offset from start 2466 instead of end with {@code -s} option). Must be a non-negative 2467 integer or an exception is thrown. If {@code count} is greater than 2468 the number number of lines (characters) in the input, the 2469 application will not error and send the whole file to the output. 2470 * @param paths Pathnames of the input files to be filtered; wildcards * and ? are 2471 supported; relative paths are resolved on the basis of the current 2472 working directory. 2473 * @return {@code this} builder to allow for method chaining; method 2474 * chaining is used here to create command chains; adding a command 2475 * to the chain usually means that the previous command <i>pipes</i> 2476 * its output to the next command (the pipe symbol in unix) 2477 */ 2478 @Override 2479 Unix4jCommandBuilder tail(long count, String... paths); 2480 /** 2481 * Reads the last {@code count} lines or characters from each of the 2482 specified files and writes them to the standard output. If more than 2483 a single file is specified and the {@code -q} option is not 2484 specified, each file is preceded by a header consisting of the 2485 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2486 of the file. 2487 * <p> 2488 * Note that the method returns {@code this} builder to allow for command 2489 * chaining. The command itself is returned by the {@link #build()} method. 2490 * See {@link Unix4jCommandBuilder class comments} for more information. 2491 * 2492 * @param options Options for the tail command. 2493 * @param count The last {@code count} lines of each input file are 2494 copied to standard output, starting from 1 (characters instead of 2495 lines if the {@code -c} option is specified, and offset from start 2496 instead of end with {@code -s} option). Must be a non-negative 2497 integer or an exception is thrown. If {@code count} is greater than 2498 the number number of lines (characters) in the input, the 2499 application will not error and send the whole file to the output. 2500 * @param files The input files to be filtered; relative paths are not resolved (use 2501 the string paths argument to enable relative path resolving based on 2502 the current working directory). 2503 * @return {@code this} builder to allow for method chaining; method 2504 * chaining is used here to create command chains; adding a command 2505 * to the chain usually means that the previous command <i>pipes</i> 2506 * its output to the next command (the pipe symbol in unix) 2507 */ 2508 @Override 2509 Unix4jCommandBuilder tail(TailOptions options, long count, java.io.File... files); 2510 /** 2511 * Reads the last {@code count} lines or characters from each of the 2512 specified files and writes them to the standard output. If more than 2513 a single file is specified and the {@code -q} option is not 2514 specified, each file is preceded by a header consisting of the 2515 string {@code "==> XXX <=="} where {@code "XXX"} is the name 2516 of the file. 2517 * <p> 2518 * Note that the method returns {@code this} builder to allow for command 2519 * chaining. The command itself is returned by the {@link #build()} method. 2520 * See {@link Unix4jCommandBuilder class comments} for more information. 2521 * 2522 * @param options Options for the tail command. 2523 * @param count The last {@code count} lines of each input file are 2524 copied to standard output, starting from 1 (characters instead of 2525 lines if the {@code -c} option is specified, and offset from start 2526 instead of end with {@code -s} option). Must be a non-negative 2527 integer or an exception is thrown. If {@code count} is greater than 2528 the number number of lines (characters) in the input, the 2529 application will not error and send the whole file to the output. 2530 * @param paths Pathnames of the input files to be filtered; wildcards * and ? are 2531 supported; relative paths are resolved on the basis of the current 2532 working directory. 2533 * @return {@code this} builder to allow for method chaining; method 2534 * chaining is used here to create command chains; adding a command 2535 * to the chain usually means that the previous command <i>pipes</i> 2536 * its output to the next command (the pipe symbol in unix) 2537 */ 2538 @Override 2539 Unix4jCommandBuilder tail(TailOptions options, long count, String... paths); 2540 2541 /* ------------------ uniq ------------------ */ 2542 /** 2543 * Reads from the standard input and compares adjacent lines, writing 2544 one copy of each input line to the standard output. The second and 2545 succeeding copies of repeated adjacent input lines are not written 2546 to the output. 2547 <p> 2548 Note that repeated lines in the input are not detected if they are 2549 not adjacent (see --global or -g option); sorted input lines always 2550 result in unique output lines. 2551 * <p> 2552 * Note that the method returns {@code this} builder to allow for command 2553 * chaining. The command itself is returned by the {@link #build()} method. 2554 * See {@link Unix4jCommandBuilder class comments} for more information. 2555 * 2556 * @return {@code this} builder to allow for method chaining; method 2557 * chaining is used here to create command chains; adding a command 2558 * to the chain usually means that the previous command <i>pipes</i> 2559 * its output to the next command (the pipe symbol in unix) 2560 */ 2561 @Override 2562 Unix4jCommandBuilder uniq(); 2563 /** 2564 * Reads the file specified by the {@code "--path"} operand (the 2565 default operand) and writes only unique lines to the standard 2566 output. The second and succeeding copies of repeated input lines are 2567 not written to the output. 2568 <p> 2569 Options can be specified by acronym (with a leading dash "-") or by 2570 long name (with two leading dashes "--"). Operands other than the 2571 default "--path" operand have to be prefixed with the operand name. 2572<p> 2573 Note that repeated lines in the input are not detected if they are 2574 not adjacent unless the --global is specified (sorted input lines 2575 always result in unique output lines). 2576 * <p> 2577 * Note that the method returns {@code this} builder to allow for command 2578 * chaining. The command itself is returned by the {@link #build()} method. 2579 * See {@link Unix4jCommandBuilder class comments} for more information. 2580 * 2581 * @param args String arguments defining the options and operands for the command. 2582 Options can be specified by acronym (with a leading dash "-") or by 2583 long name (with two leading dashes "--"). Operands other than the 2584 default "--path" operand have to be prefixed with the operand 2585 name. 2586 * @return {@code this} builder to allow for method chaining; method 2587 * chaining is used here to create command chains; adding a command 2588 * to the chain usually means that the previous command <i>pipes</i> 2589 * its output to the next command (the pipe symbol in unix) 2590 */ 2591 @Override 2592 Unix4jCommandBuilder uniq(String... args); 2593 /** 2594 * Reads from the specified input {@code file} and compares adjacent 2595 lines, writing one copy of each input line to the standard output. 2596 The second and succeeding copies of repeated adjacent input lines 2597 are not written to the output. 2598 <p> 2599 Note that repeated lines in the input are not detected if they are 2600 not adjacent (see --global or -g option); sorted input lines always 2601 result in unique output lines. 2602 * <p> 2603 * Note that the method returns {@code this} builder to allow for command 2604 * chaining. The command itself is returned by the {@link #build()} method. 2605 * See {@link Unix4jCommandBuilder class comments} for more information. 2606 * 2607 * @param file The files or directories used as starting point for the listing; 2608 relative paths are not resolved (use the string path argument to 2609 enable relative path resolving based on the current working 2610 directory). 2611 * @return {@code this} builder to allow for method chaining; method 2612 * chaining is used here to create command chains; adding a command 2613 * to the chain usually means that the previous command <i>pipes</i> 2614 * its output to the next command (the pipe symbol in unix) 2615 */ 2616 @Override 2617 Unix4jCommandBuilder uniq(java.io.File file); 2618 /** 2619 * Reads the file specified by its {@code path} and compares adjacent 2620 lines, writing one copy of each input line to the standard output. 2621 The second and succeeding copies of repeated adjacent input lines 2622 are not written to the output. 2623 <p> 2624 Note that repeated lines in the input are not detected if they are 2625 not adjacent (see --global or -g option); sorted input lines always 2626 result in unique output lines. 2627 * <p> 2628 * Note that the method returns {@code this} builder to allow for command 2629 * chaining. The command itself is returned by the {@link #build()} method. 2630 * See {@link Unix4jCommandBuilder class comments} for more information. 2631 * 2632 * @param path The files or directories used as starting point for the listing; 2633 wildcards * and ? are supported; relative paths are resolved on the 2634 basis of the current working directory. 2635 * @return {@code this} builder to allow for method chaining; method 2636 * chaining is used here to create command chains; adding a command 2637 * to the chain usually means that the previous command <i>pipes</i> 2638 * its output to the next command (the pipe symbol in unix) 2639 */ 2640 @Override 2641 Unix4jCommandBuilder uniq(String path); 2642 /** 2643 * Reads from the standard input and compares adjacent lines, writing 2644 one copy of each input line to the standard output. The second and 2645 succeeding copies of repeated adjacent input lines are not written 2646 to the output. 2647 <p> 2648 Note that repeated non-adjacent lines in the input are only detected 2649 with the --global or -g option. In other words, unique output lines 2650 are guaranteed only if either (a) the --global or -g option is 2651 specified, or (b) the input lines are sorted. 2652 * <p> 2653 * Note that the method returns {@code this} builder to allow for command 2654 * chaining. The command itself is returned by the {@link #build()} method. 2655 * See {@link Unix4jCommandBuilder class comments} for more information. 2656 * 2657 * @param options The options defining the uniqueness details for the output lines. 2658 * @return {@code this} builder to allow for method chaining; method 2659 * chaining is used here to create command chains; adding a command 2660 * to the chain usually means that the previous command <i>pipes</i> 2661 * its output to the next command (the pipe symbol in unix) 2662 */ 2663 @Override 2664 Unix4jCommandBuilder uniq(UniqOptions options); 2665 /** 2666 * Reads from the specified input {@code file} and compares adjacent 2667 lines, writing one copy of each input line to the standard output. 2668 The second and succeeding copies of repeated adjacent input lines 2669 are not written to the output. 2670 <p> 2671 Note that repeated non-adjacent lines in the input are only detected 2672 with the --global or -g option. In other words, unique output lines 2673 are guaranteed only if either (a) the --global or -g option is 2674 specified, or (b) the input lines are sorted. 2675 * <p> 2676 * Note that the method returns {@code this} builder to allow for command 2677 * chaining. The command itself is returned by the {@link #build()} method. 2678 * See {@link Unix4jCommandBuilder class comments} for more information. 2679 * 2680 * @param options The options defining the uniqueness details for the output lines. 2681 * @param file The files or directories used as starting point for the listing; 2682 relative paths are not resolved (use the string path argument to 2683 enable relative path resolving based on the current working 2684 directory). 2685 * @return {@code this} builder to allow for method chaining; method 2686 * chaining is used here to create command chains; adding a command 2687 * to the chain usually means that the previous command <i>pipes</i> 2688 * its output to the next command (the pipe symbol in unix) 2689 */ 2690 @Override 2691 Unix4jCommandBuilder uniq(UniqOptions options, java.io.File file); 2692 /** 2693 * Reads the file specified by its {@code path} and compares adjacent 2694 lines, writing one copy of each input line to the standard output. 2695 The second and succeeding copies of repeated adjacent input lines 2696 are not written to the output. 2697 <p> 2698 Note that repeated non-adjacent lines in the input are only detected 2699 with the --global or -g option. In other words, unique output lines 2700 are guaranteed only if either (a) the --global or -g option is 2701 specified, or (b) the input lines are sorted. 2702 * <p> 2703 * Note that the method returns {@code this} builder to allow for command 2704 * chaining. The command itself is returned by the {@link #build()} method. 2705 * See {@link Unix4jCommandBuilder class comments} for more information. 2706 * 2707 * @param options The options defining the uniqueness details for the output lines. 2708 * @param path The files or directories used as starting point for the listing; 2709 wildcards * and ? are supported; relative paths are resolved on the 2710 basis of the current working directory. 2711 * @return {@code this} builder to allow for method chaining; method 2712 * chaining is used here to create command chains; adding a command 2713 * to the chain usually means that the previous command <i>pipes</i> 2714 * its output to the next command (the pipe symbol in unix) 2715 */ 2716 @Override 2717 Unix4jCommandBuilder uniq(UniqOptions options, String path); 2718 2719 /* ------------------ wc ------------------ */ 2720 /** 2721 * Executes a count of lines, words and chars contained in the standard 2722 input and writes them to the standard output. 2723 * <p> 2724 * Note that the method returns {@code this} builder to allow for command 2725 * chaining. The command itself is returned by the {@link #build()} method. 2726 * See {@link Unix4jCommandBuilder class comments} for more information. 2727 * 2728 * @return {@code this} builder to allow for method chaining; method 2729 * chaining is used here to create command chains; adding a command 2730 * to the chain usually means that the previous command <i>pipes</i> 2731 * its output to the next command (the pipe symbol in unix) 2732 */ 2733 @Override 2734 Unix4jCommandBuilder wc(); 2735 /** 2736 * One or several counts are executed and written to the standard 2737 output. Counts include lines, words and chars (depending on the 2738 provided options) and cumulative counts for all the files are 2739 displayed on a separate line after the output for the last file if 2740 more than one input file is specified. 2741<p> 2742 Options can be specified by acronym (with a leading dash "-") or by 2743 long name (with two leading dashes "--"). Operands other than the 2744 default "--paths" operand have to be prefixed with the operand 2745 name. 2746 * <p> 2747 * Note that the method returns {@code this} builder to allow for command 2748 * chaining. The command itself is returned by the {@link #build()} method. 2749 * See {@link Unix4jCommandBuilder class comments} for more information. 2750 * 2751 * @param args String arguments defining the options and operands for the command. 2752 Options can be specified by acronym (with a leading dash "-") or by 2753 long name (with two leading dashes "--"). Operands other than the 2754 default "--paths" operand have to be prefixed with the operand 2755 name. 2756 * @return {@code this} builder to allow for method chaining; method 2757 * chaining is used here to create command chains; adding a command 2758 * to the chain usually means that the previous command <i>pipes</i> 2759 * its output to the next command (the pipe symbol in unix) 2760 */ 2761 @Override 2762 Unix4jCommandBuilder wc(String... args); 2763 /** 2764 * Executes a count of lines, words and chars contained in each input 2765 file and writes them to the standard output. If more than one input 2766 file is specified, a line of cumulative counts for all the files is 2767 displayed on a separate line after the output for the last file. 2768 * <p> 2769 * Note that the method returns {@code this} builder to allow for command 2770 * chaining. The command itself is returned by the {@link #build()} method. 2771 * See {@link Unix4jCommandBuilder class comments} for more information. 2772 * 2773 * @param files The input files; relative paths are not resolved (use the string 2774 paths argument to enable relative path resolving based on the 2775 current working directory). 2776 * @return {@code this} builder to allow for method chaining; method 2777 * chaining is used here to create command chains; adding a command 2778 * to the chain usually means that the previous command <i>pipes</i> 2779 * its output to the next command (the pipe symbol in unix) 2780 */ 2781 @Override 2782 Unix4jCommandBuilder wc(java.io.File... files); 2783 /** 2784 * Executes a one or more counts, depending on the given options, in 2785 the standard input and writes them to the standard output. 2786 * <p> 2787 * Note that the method returns {@code this} builder to allow for command 2788 * chaining. The command itself is returned by the {@link #build()} method. 2789 * See {@link Unix4jCommandBuilder class comments} for more information. 2790 * 2791 * @param options The options defining command behavior. 2792 * @return {@code this} builder to allow for method chaining; method 2793 * chaining is used here to create command chains; adding a command 2794 * to the chain usually means that the previous command <i>pipes</i> 2795 * its output to the next command (the pipe symbol in unix) 2796 */ 2797 @Override 2798 Unix4jCommandBuilder wc(WcOptions options); 2799 /** 2800 * Executes a one or more counts, depending on the given options, in 2801 each of the given input files and writes them to the standard 2802 output. If more than one input file is specified, a line of 2803 cumulative counts for all the files is displayed on a separate line 2804 after the output for the last file. 2805 * <p> 2806 * Note that the method returns {@code this} builder to allow for command 2807 * chaining. The command itself is returned by the {@link #build()} method. 2808 * See {@link Unix4jCommandBuilder class comments} for more information. 2809 * 2810 * @param options The options defining command behavior. 2811 * @param files The input files; relative paths are not resolved (use the string 2812 paths argument to enable relative path resolving based on the 2813 current working directory). 2814 * @return {@code this} builder to allow for method chaining; method 2815 * chaining is used here to create command chains; adding a command 2816 * to the chain usually means that the previous command <i>pipes</i> 2817 * its output to the next command (the pipe symbol in unix) 2818 */ 2819 @Override 2820 Unix4jCommandBuilder wc(WcOptions options, java.io.File... files); 2821 /** 2822 * Executes a one or more counts, depending on the given options, in 2823 each of the given input files and writes them to the standard 2824 output. If more than one input file is specified, a line of 2825 cumulative counts for all the files is displayed on a separate line 2826 after the output for the last file. 2827 * <p> 2828 * Note that the method returns {@code this} builder to allow for command 2829 * chaining. The command itself is returned by the {@link #build()} method. 2830 * See {@link Unix4jCommandBuilder class comments} for more information. 2831 * 2832 * @param options The options defining command behavior. 2833 * @param paths Pathnames of the input files; wildcards * and ? are supported; 2834 relative paths are resolved on the basis of the current working 2835 directory. 2836 * @return {@code this} builder to allow for method chaining; method 2837 * chaining is used here to create command chains; adding a command 2838 * to the chain usually means that the previous command <i>pipes</i> 2839 * its output to the next command (the pipe symbol in unix) 2840 */ 2841 @Override 2842 Unix4jCommandBuilder wc(WcOptions options, String[] paths); 2843 2844 /* ------------------ xargs ------------------ */ 2845 /** 2846 * Reads items from the standard input, delimited by blanks (which can 2847 be protected with double or single quotes or a backslash) or 2848 newlines, and provides variables for the items read from the 2849 standard input. The command following after xargs is executed once 2850 for every input line; the item variables are usually passed to the 2851 invoked command as arguments. 2852 * <p> 2853 * Note that the method returns {@code this} builder to allow for command 2854 * chaining. The command itself is returned by the {@link #build()} method. 2855 * See {@link Unix4jCommandBuilder class comments} for more information. 2856 * 2857 * @return {@code this} builder to allow for method chaining; method 2858 * chaining is used here to create command chains; adding a command 2859 * to the chain usually means that the previous command <i>pipes</i> 2860 * its output to the next command (the pipe symbol in unix) 2861 */ 2862 @Override 2863 Unix4jCommandBuilder xargs(); 2864 /** 2865 * Reads items from the standard input, delimited by blanks and 2866 newlines or a specified delimiter, and provides variables for the 2867 items read from the standard input. The command following after 2868 xargs is executed once for every input line (or for multiple lines 2869 depending on the input options); the item variables are usually 2870 passed to the invoked command as arguments. 2871 <p> 2872 Options can be specified by acronym (with a leading dash "-") or by 2873 long name (with two leading dashes "--"). Operands other than the 2874 default "--maxArgs" operand have to be prefixed with the operand 2875 name. 2876 * <p> 2877 * Note that the method returns {@code this} builder to allow for command 2878 * chaining. The command itself is returned by the {@link #build()} method. 2879 * See {@link Unix4jCommandBuilder class comments} for more information. 2880 * 2881 * @param args String arguments defining the options and operands for the command. 2882 Options can be specified by acronym (with a leading dash "-") or by 2883 long name (with two leading dashes "--"). Operands other than the 2884 default "--maxArgs" operand have to be prefixed with the operand 2885 name (e.g. "--maxLines" for a subsequent line count operand value). 2886 * @return {@code this} builder to allow for method chaining; method 2887 * chaining is used here to create command chains; adding a command 2888 * to the chain usually means that the previous command <i>pipes</i> 2889 * its output to the next command (the pipe symbol in unix) 2890 */ 2891 @Override 2892 Unix4jCommandBuilder xargs(String... args); 2893 /** 2894 * Reads items from the standard input using the specified delimiter to 2895 separate items, and provides variables for the items read from the 2896 standard input. The command following after xargs is executed once 2897 for every input line; the item variables are usually passed to the 2898 invoked command as arguments. 2899 * <p> 2900 * Note that the method returns {@code this} builder to allow for command 2901 * chaining. The command itself is returned by the {@link #build()} method. 2902 * See {@link Unix4jCommandBuilder class comments} for more information. 2903 * 2904 * @param delimiter Input items are terminated by the specified characters. 2905 * @return {@code this} builder to allow for method chaining; method 2906 * chaining is used here to create command chains; adding a command 2907 * to the chain usually means that the previous command <i>pipes</i> 2908 * its output to the next command (the pipe symbol in unix) 2909 */ 2910 @Override 2911 Unix4jCommandBuilder xargs(String delimiter); 2912 /** 2913 * Reads items from the standard input, delimited by blanks (which can 2914 be protected with double or single quotes or a backslash) or 2915 newlines, and provides variables for the items read from the 2916 standard input. The command following after xargs is executed once 2917 for every {@code maxLines} nonblank input lines (or possibly fewer 2918 for the last invocation with the remaining lines at the end of the 2919 file). The item variables are usually passed to the invoked command 2920 as arguments. 2921 * <p> 2922 * Note that the method returns {@code this} builder to allow for command 2923 * chaining. The command itself is returned by the {@link #build()} method. 2924 * See {@link Unix4jCommandBuilder class comments} for more information. 2925 * 2926 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 2927 * @return {@code this} builder to allow for method chaining; method 2928 * chaining is used here to create command chains; adding a command 2929 * to the chain usually means that the previous command <i>pipes</i> 2930 * its output to the next command (the pipe symbol in unix) 2931 */ 2932 @Override 2933 Unix4jCommandBuilder xargs(long maxLines); 2934 /** 2935 * Reads items from the standard input, delimited by blanks (which can 2936 be protected with double or single quotes or a backslash) or 2937 newlines, and provides variables for the items read from the 2938 standard input. The command following after xargs is executed once 2939 for every {@code maxArgs} items read from the standard input (or 2940 possibly fewer for the last invocation with the remaining items at 2941 the end of the file). The item variables are usually passed to the 2942 invoked command as arguments. 2943 * <p> 2944 * Note that the method returns {@code this} builder to allow for command 2945 * chaining. The command itself is returned by the {@link #build()} method. 2946 * See {@link Unix4jCommandBuilder class comments} for more information. 2947 * 2948 * @param maxArgs Use at most maxArgs arguments per command invocation. 2949 * @return {@code this} builder to allow for method chaining; method 2950 * chaining is used here to create command chains; adding a command 2951 * to the chain usually means that the previous command <i>pipes</i> 2952 * its output to the next command (the pipe symbol in unix) 2953 */ 2954 @Override 2955 Unix4jCommandBuilder xargs(int maxArgs); 2956 /** 2957 * Reads items from the standard input, delimited by blanks (which can 2958 be protected with double or single quotes or a backslash) or 2959 newlines, and provides variables for the items read from the 2960 standard input. The command following after xargs is executed once 2961 for every {@code maxLines} nonblank input lines or {@code maxArgs} 2962 items (whichever occurs first). Fewer lines or items may be used for 2963 the last invocation with the remaining lines at the end of the file. 2964 The item variables are usually passed to the invoked command as 2965 arguments. 2966 * <p> 2967 * Note that the method returns {@code this} builder to allow for command 2968 * chaining. The command itself is returned by the {@link #build()} method. 2969 * See {@link Unix4jCommandBuilder class comments} for more information. 2970 * 2971 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 2972 * @param maxArgs Use at most maxArgs arguments per command invocation. 2973 * @return {@code this} builder to allow for method chaining; method 2974 * chaining is used here to create command chains; adding a command 2975 * to the chain usually means that the previous command <i>pipes</i> 2976 * its output to the next command (the pipe symbol in unix) 2977 */ 2978 @Override 2979 Unix4jCommandBuilder xargs(long maxLines, int maxArgs); 2980 /** 2981 * Reads items from the standard input using the specified delimiter to 2982 separate items, and provides variables for the items read from the 2983 standard input. The command following after xargs is executed once 2984 for every {@code maxLines} nonblank input lines (or possibly fewer 2985 for the last invocation with the remaining lines at the end of the 2986 file). The item variables are usually passed to the invoked command 2987 as arguments. 2988 * <p> 2989 * Note that the method returns {@code this} builder to allow for command 2990 * chaining. The command itself is returned by the {@link #build()} method. 2991 * See {@link Unix4jCommandBuilder class comments} for more information. 2992 * 2993 * @param delimiter Input items are terminated by the specified characters. 2994 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 2995 * @return {@code this} builder to allow for method chaining; method 2996 * chaining is used here to create command chains; adding a command 2997 * to the chain usually means that the previous command <i>pipes</i> 2998 * its output to the next command (the pipe symbol in unix) 2999 */ 3000 @Override 3001 Unix4jCommandBuilder xargs(String delimiter, long maxLines); 3002 /** 3003 * Reads items from the standard input using the specified delimiter to 3004 separate items, and provides variables for the items read from the 3005 standard input. The command following after xargs is executed once 3006 for every {@code maxArgs} items read from the standard input (or 3007 possibly fewer for the last invocation with the remaining items at 3008 the end of the file). The item variables are usually passed to the 3009 invoked command as arguments. 3010 * <p> 3011 * Note that the method returns {@code this} builder to allow for command 3012 * chaining. The command itself is returned by the {@link #build()} method. 3013 * See {@link Unix4jCommandBuilder class comments} for more information. 3014 * 3015 * @param delimiter Input items are terminated by the specified characters. 3016 * @param maxArgs Use at most maxArgs arguments per command invocation. 3017 * @return {@code this} builder to allow for method chaining; method 3018 * chaining is used here to create command chains; adding a command 3019 * to the chain usually means that the previous command <i>pipes</i> 3020 * its output to the next command (the pipe symbol in unix) 3021 */ 3022 @Override 3023 Unix4jCommandBuilder xargs(String delimiter, int maxArgs); 3024 /** 3025 * Reads items from the standard input using the specified delimiter to 3026 separate items, and provides variables for the items read from the 3027 standard input. The command following after xargs is executed once 3028 for every {@code maxLines} nonblank input lines or {@code maxArgs} 3029 items (whichever occurs first). Fewer lines or items may be used for 3030 the last invocation with the remaining lines at the end of the file. 3031 The item variables are usually passed to the invoked command as 3032 arguments. 3033 * <p> 3034 * Note that the method returns {@code this} builder to allow for command 3035 * chaining. The command itself is returned by the {@link #build()} method. 3036 * See {@link Unix4jCommandBuilder class comments} for more information. 3037 * 3038 * @param delimiter Input items are terminated by the specified characters. 3039 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3040 * @param maxArgs Use at most maxArgs arguments per command invocation. 3041 * @return {@code this} builder to allow for method chaining; method 3042 * chaining is used here to create command chains; adding a command 3043 * to the chain usually means that the previous command <i>pipes</i> 3044 * its output to the next command (the pipe symbol in unix) 3045 */ 3046 @Override 3047 Unix4jCommandBuilder xargs(String delimiter, long maxLines, int maxArgs); 3048 /** 3049 * Reads items from the standard input using the specified delimiter to 3050 separate items, and provides variables for the items read from the 3051 standard input. If the {@code eof} string occurs as a line of input, 3052 the rest of the input is ignored. The command following after xargs 3053 is executed once for every {@code maxLines} nonblank input lines or 3054 {@code maxArgs} items (whichever occurs first). Fewer lines or items 3055 may be used for the last invocation with the remaining lines at the 3056 end of the file. The item variables are usually passed to the 3057 invoked command as arguments. 3058 * <p> 3059 * Note that the method returns {@code this} builder to allow for command 3060 * chaining. The command itself is returned by the {@link #build()} method. 3061 * See {@link Unix4jCommandBuilder class comments} for more information. 3062 * 3063 * @param delimiter Input items are terminated by the specified characters. 3064 * @param eof If the end of file string occurs as a line of input, the rest of the 3065 input is ignored. 3066 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3067 * @param maxArgs Use at most maxArgs arguments per command invocation. 3068 * @return {@code this} builder to allow for method chaining; method 3069 * chaining is used here to create command chains; adding a command 3070 * to the chain usually means that the previous command <i>pipes</i> 3071 * its output to the next command (the pipe symbol in unix) 3072 */ 3073 @Override 3074 Unix4jCommandBuilder xargs(String delimiter, String eof, long maxLines, int maxArgs); 3075 /** 3076 * Reads items from the standard input, delimited by blanks (which can 3077 be protected with double or single quotes or a backslash) or 3078 newlines, and provides variables for the items read from the 3079 standard input. The command following after xargs is executed once 3080 for every input line; the item variables are usually passed to the 3081 invoked command as arguments. 3082 * <p> 3083 * Note that the method returns {@code this} builder to allow for command 3084 * chaining. The command itself is returned by the {@link #build()} method. 3085 * See {@link Unix4jCommandBuilder class comments} for more information. 3086 * 3087 * @param options The options defining command behavior. 3088 * @return {@code this} builder to allow for method chaining; method 3089 * chaining is used here to create command chains; adding a command 3090 * to the chain usually means that the previous command <i>pipes</i> 3091 * its output to the next command (the pipe symbol in unix) 3092 */ 3093 @Override 3094 Unix4jCommandBuilder xargs(XargsOptions options); 3095 /** 3096 * Reads items from the standard input using the specified delimiter to 3097 separate items, and provides variables for the items read from the 3098 standard input. The command following after xargs is executed once 3099 for every input line; the item variables are usually passed to the 3100 invoked command as arguments. 3101 * <p> 3102 * Note that the method returns {@code this} builder to allow for command 3103 * chaining. The command itself is returned by the {@link #build()} method. 3104 * See {@link Unix4jCommandBuilder class comments} for more information. 3105 * 3106 * @param options The options defining command behavior. 3107 * @param delimiter Input items are terminated by the specified characters. 3108 * @return {@code this} builder to allow for method chaining; method 3109 * chaining is used here to create command chains; adding a command 3110 * to the chain usually means that the previous command <i>pipes</i> 3111 * its output to the next command (the pipe symbol in unix) 3112 */ 3113 @Override 3114 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter); 3115 /** 3116 * Reads items from the standard input, delimited by blanks (which can 3117 be protected with double or single quotes or a backslash) or 3118 newlines, and provides variables for the items read from the 3119 standard input. The command following after xargs is executed once 3120 for every {@code maxLines} nonblank input lines (or possibly fewer 3121 for the last invocation with the remaining lines at the end of the 3122 file). The item variables are usually passed to the invoked command 3123 as arguments. 3124 * <p> 3125 * Note that the method returns {@code this} builder to allow for command 3126 * chaining. The command itself is returned by the {@link #build()} method. 3127 * See {@link Unix4jCommandBuilder class comments} for more information. 3128 * 3129 * @param options The options defining command behavior. 3130 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3131 * @return {@code this} builder to allow for method chaining; method 3132 * chaining is used here to create command chains; adding a command 3133 * to the chain usually means that the previous command <i>pipes</i> 3134 * its output to the next command (the pipe symbol in unix) 3135 */ 3136 @Override 3137 Unix4jCommandBuilder xargs(XargsOptions options, long maxLines); 3138 /** 3139 * Reads items from the standard input, delimited by blanks (which can 3140 be protected with double or single quotes or a backslash) or 3141 newlines, and provides variables for the items read from the 3142 standard input. The command following after xargs is executed once 3143 for every {@code maxArgs} items read from the standard input (or 3144 possibly fewer for the last invocation with the remaining items at 3145 the end of the file). The item variables are usually passed to the 3146 invoked command as arguments. 3147 * <p> 3148 * Note that the method returns {@code this} builder to allow for command 3149 * chaining. The command itself is returned by the {@link #build()} method. 3150 * See {@link Unix4jCommandBuilder class comments} for more information. 3151 * 3152 * @param options The options defining command behavior. 3153 * @param maxArgs Use at most maxArgs arguments per command invocation. 3154 * @return {@code this} builder to allow for method chaining; method 3155 * chaining is used here to create command chains; adding a command 3156 * to the chain usually means that the previous command <i>pipes</i> 3157 * its output to the next command (the pipe symbol in unix) 3158 */ 3159 @Override 3160 Unix4jCommandBuilder xargs(XargsOptions options, int maxArgs); 3161 /** 3162 * Reads items from the standard input, delimited by blanks (which can 3163 be protected with double or single quotes or a backslash) or 3164 newlines, and provides variables for the items read from the 3165 standard input. The command following after xargs is executed once 3166 for every {@code maxLines} nonblank input lines or {@code maxArgs} 3167 items (whichever occurs first). Fewer lines or items may be used for 3168 the last invocation with the remaining lines at the end of the file. 3169 The item variables are usually passed to the invoked command as 3170 arguments. 3171 * <p> 3172 * Note that the method returns {@code this} builder to allow for command 3173 * chaining. The command itself is returned by the {@link #build()} method. 3174 * See {@link Unix4jCommandBuilder class comments} for more information. 3175 * 3176 * @param options The options defining command behavior. 3177 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3178 * @param maxArgs Use at most maxArgs arguments per command invocation. 3179 * @return {@code this} builder to allow for method chaining; method 3180 * chaining is used here to create command chains; adding a command 3181 * to the chain usually means that the previous command <i>pipes</i> 3182 * its output to the next command (the pipe symbol in unix) 3183 */ 3184 @Override 3185 Unix4jCommandBuilder xargs(XargsOptions options, long maxLines, int maxArgs); 3186 /** 3187 * Reads items from the standard input using the specified delimiter to 3188 separate items, and provides variables for the items read from the 3189 standard input. The command following after xargs is executed once 3190 for every {@code maxLines} nonblank input lines (or possibly fewer 3191 for the last invocation with the remaining lines at the end of the 3192 file). The item variables are usually passed to the invoked command 3193 as arguments. 3194 * <p> 3195 * Note that the method returns {@code this} builder to allow for command 3196 * chaining. The command itself is returned by the {@link #build()} method. 3197 * See {@link Unix4jCommandBuilder class comments} for more information. 3198 * 3199 * @param options The options defining command behavior. 3200 * @param delimiter Input items are terminated by the specified characters. 3201 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3202 * @return {@code this} builder to allow for method chaining; method 3203 * chaining is used here to create command chains; adding a command 3204 * to the chain usually means that the previous command <i>pipes</i> 3205 * its output to the next command (the pipe symbol in unix) 3206 */ 3207 @Override 3208 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter, long maxLines); 3209 /** 3210 * Reads items from the standard input using the specified delimiter to 3211 separate items, and provides variables for the items read from the 3212 standard input. The command following after xargs is executed once 3213 for every {@code maxArgs} items read from the standard input (or 3214 possibly fewer for the last invocation with the remaining items at 3215 the end of the file). The item variables are usually passed to the 3216 invoked command as arguments. 3217 * <p> 3218 * Note that the method returns {@code this} builder to allow for command 3219 * chaining. The command itself is returned by the {@link #build()} method. 3220 * See {@link Unix4jCommandBuilder class comments} for more information. 3221 * 3222 * @param options The options defining command behavior. 3223 * @param delimiter Input items are terminated by the specified characters. 3224 * @param maxArgs Use at most maxArgs arguments per command invocation. 3225 * @return {@code this} builder to allow for method chaining; method 3226 * chaining is used here to create command chains; adding a command 3227 * to the chain usually means that the previous command <i>pipes</i> 3228 * its output to the next command (the pipe symbol in unix) 3229 */ 3230 @Override 3231 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter, int maxArgs); 3232 /** 3233 * Reads items from the standard input using the specified delimiter to 3234 separate items, and provides variables for the items read from the 3235 standard input. The command following after xargs is executed once 3236 for every {@code maxLines} nonblank input lines or {@code maxArgs} 3237 items (whichever occurs first). Fewer lines or items may be used for 3238 the last invocation with the remaining lines at the end of the file. 3239 The item variables are usually passed to the invoked command as 3240 arguments. 3241 * <p> 3242 * Note that the method returns {@code this} builder to allow for command 3243 * chaining. The command itself is returned by the {@link #build()} method. 3244 * See {@link Unix4jCommandBuilder class comments} for more information. 3245 * 3246 * @param options The options defining command behavior. 3247 * @param delimiter Input items are terminated by the specified characters. 3248 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3249 * @param maxArgs Use at most maxArgs arguments per command invocation. 3250 * @return {@code this} builder to allow for method chaining; method 3251 * chaining is used here to create command chains; adding a command 3252 * to the chain usually means that the previous command <i>pipes</i> 3253 * its output to the next command (the pipe symbol in unix) 3254 */ 3255 @Override 3256 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter, long maxLines, int maxArgs); 3257 /** 3258 * Reads items from the standard input using the specified delimiter to 3259 separate items, and provides variables for the items read from the 3260 standard input. If the {@code eof} string occurs as a line of input, 3261 the rest of the input is ignored. The command following after xargs 3262 is executed once for every {@code maxLines} nonblank input lines or 3263 {@code maxArgs} items (whichever occurs first). Fewer lines or items 3264 may be used for the last invocation with the remaining lines at the 3265 end of the file. The item variables are usually passed to the 3266 invoked command as arguments. 3267 * <p> 3268 * Note that the method returns {@code this} builder to allow for command 3269 * chaining. The command itself is returned by the {@link #build()} method. 3270 * See {@link Unix4jCommandBuilder class comments} for more information. 3271 * 3272 * @param options The options defining command behavior. 3273 * @param delimiter Input items are terminated by the specified characters. 3274 * @param eof If the end of file string occurs as a line of input, the rest of the 3275 input is ignored. 3276 * @param maxLines Use at most maxLines nonblank input lines per command invocation. 3277 * @param maxArgs Use at most maxArgs arguments per command invocation. 3278 * @return {@code this} builder to allow for method chaining; method 3279 * chaining is used here to create command chains; adding a command 3280 * to the chain usually means that the previous command <i>pipes</i> 3281 * its output to the next command (the pipe symbol in unix) 3282 */ 3283 @Override 3284 Unix4jCommandBuilder xargs(XargsOptions options, String delimiter, String eof, long maxLines, int maxArgs); 3285 3286 //override with specialized return type 3287 @Override 3288 Unix4jCommandBuilder join(Command<?> command); 3289 3290 //override with specialized return type 3291 @Override 3292 Unix4jCommandBuilder apply(LineOperation operation); 3293 3294 //override with specialized return type 3295 @Override 3296 Unix4jCommandBuilder reset(); 3297 3298}