equal
deleted
inserted
replaced
63 * |
63 * |
64 * <li>a <i>working directory</i>. The default value is the current |
64 * <li>a <i>working directory</i>. The default value is the current |
65 * working directory of the current process, usually the directory |
65 * working directory of the current process, usually the directory |
66 * named by the system property {@code user.dir}. |
66 * named by the system property {@code user.dir}. |
67 * |
67 * |
68 * <li><a name="redirect-input">a source of <i>standard input</i>. |
68 * <li><a name="redirect-input">a source of <i>standard input</i></a>. |
69 * By default, the subprocess reads input from a pipe. Java code |
69 * By default, the subprocess reads input from a pipe. Java code |
70 * can access this pipe via the output stream returned by |
70 * can access this pipe via the output stream returned by |
71 * {@link Process#getOutputStream()}. However, standard input may |
71 * {@link Process#getOutputStream()}. However, standard input may |
72 * be redirected to another source using |
72 * be redirected to another source using |
73 * {@link #redirectInput(Redirect) redirectInput}. |
73 * {@link #redirectInput(Redirect) redirectInput}. |
79 * throw {@code IOException} |
79 * throw {@code IOException} |
80 * <li>the {@link OutputStream#close() close} method does nothing |
80 * <li>the {@link OutputStream#close() close} method does nothing |
81 * </ul> |
81 * </ul> |
82 * |
82 * |
83 * <li><a name="redirect-output">a destination for <i>standard output</i> |
83 * <li><a name="redirect-output">a destination for <i>standard output</i> |
84 * and <i>standard error</i>. By default, the subprocess writes standard |
84 * and <i>standard error</i></a>. By default, the subprocess writes standard |
85 * output and standard error to pipes. Java code can access these pipes |
85 * output and standard error to pipes. Java code can access these pipes |
86 * via the input streams returned by {@link Process#getInputStream()} and |
86 * via the input streams returned by {@link Process#getInputStream()} and |
87 * {@link Process#getErrorStream()}. However, standard output and |
87 * {@link Process#getErrorStream()}. However, standard output and |
88 * standard error may be redirected to other destinations using |
88 * standard error may be redirected to other destinations using |
89 * {@link #redirectOutput(Redirect) redirectOutput} and |
89 * {@link #redirectOutput(Redirect) redirectOutput} and |
552 * <pre> {@code |
552 * <pre> {@code |
553 * Redirect.from(file).file() == file && |
553 * Redirect.from(file).file() == file && |
554 * Redirect.from(file).type() == Redirect.Type.READ |
554 * Redirect.from(file).type() == Redirect.Type.READ |
555 * }</pre> |
555 * }</pre> |
556 * |
556 * |
|
557 * @param file The {@code File} for the {@code Redirect}. |
557 * @throws NullPointerException if the specified file is null |
558 * @throws NullPointerException if the specified file is null |
558 * @return a redirect to read from the specified file |
559 * @return a redirect to read from the specified file |
559 */ |
560 */ |
560 public static Redirect from(final File file) { |
561 public static Redirect from(final File file) { |
561 if (file == null) |
562 if (file == null) |
578 * <pre> {@code |
579 * <pre> {@code |
579 * Redirect.to(file).file() == file && |
580 * Redirect.to(file).file() == file && |
580 * Redirect.to(file).type() == Redirect.Type.WRITE |
581 * Redirect.to(file).type() == Redirect.Type.WRITE |
581 * }</pre> |
582 * }</pre> |
582 * |
583 * |
|
584 * @param file The {@code File} for the {@code Redirect}. |
583 * @throws NullPointerException if the specified file is null |
585 * @throws NullPointerException if the specified file is null |
584 * @return a redirect to write to the specified file |
586 * @return a redirect to write to the specified file |
585 */ |
587 */ |
586 public static Redirect to(final File file) { |
588 public static Redirect to(final File file) { |
587 if (file == null) |
589 if (file == null) |
608 * <pre> {@code |
610 * <pre> {@code |
609 * Redirect.appendTo(file).file() == file && |
611 * Redirect.appendTo(file).file() == file && |
610 * Redirect.appendTo(file).type() == Redirect.Type.APPEND |
612 * Redirect.appendTo(file).type() == Redirect.Type.APPEND |
611 * }</pre> |
613 * }</pre> |
612 * |
614 * |
|
615 * @param file The {@code File} for the {@code Redirect}. |
613 * @throws NullPointerException if the specified file is null |
616 * @throws NullPointerException if the specified file is null |
614 * @return a redirect to append to the specified file |
617 * @return a redirect to append to the specified file |
615 */ |
618 */ |
616 public static Redirect appendTo(final File file) { |
619 public static Redirect appendTo(final File file) { |
617 if (file == null) |
620 if (file == null) |