equal
deleted
inserted
replaced
28 import java.io.File; |
28 import java.io.File; |
29 import java.io.FileDescriptor; |
29 import java.io.FileDescriptor; |
30 import java.io.IOException; |
30 import java.io.IOException; |
31 import java.io.InputStream; |
31 import java.io.InputStream; |
32 import java.io.OutputStream; |
32 import java.io.OutputStream; |
33 import java.nio.channels.Pipe; |
|
34 import java.util.Arrays; |
33 import java.util.Arrays; |
35 import java.util.ArrayList; |
34 import java.util.ArrayList; |
36 import java.util.List; |
35 import java.util.List; |
37 import java.util.Map; |
36 import java.util.Map; |
38 import java.security.AccessController; |
37 import sun.security.action.GetPropertyAction; |
39 import java.security.PrivilegedAction; |
38 |
40 /** |
39 /** |
41 * This class is used to create operating system processes. |
40 * This class is used to create operating system processes. |
42 * |
41 * |
43 * <p>Each {@code ProcessBuilder} instance manages a collection |
42 * <p>Each {@code ProcessBuilder} instance manages a collection |
44 * of process attributes. The {@link #start()} method creates a new |
43 * of process attributes. The {@link #start()} method creates a new |
466 * {@link Type Type}. |
465 * {@link Type Type}. |
467 * |
466 * |
468 * @since 1.7 |
467 * @since 1.7 |
469 */ |
468 */ |
470 public abstract static class Redirect { |
469 public abstract static class Redirect { |
471 private static final File NULL_FILE = AccessController.doPrivileged( |
470 private static final File NULL_FILE = new File( |
472 (PrivilegedAction<File>) () -> { |
471 (GetPropertyAction.getProperty("os.name") |
473 return new File((System.getProperty("os.name") |
472 .startsWith("Windows") ? "NUL" : "/dev/null") |
474 .startsWith("Windows") ? "NUL" : "/dev/null")); |
|
475 } |
|
476 ); |
473 ); |
477 |
474 |
478 /** |
475 /** |
479 * The type of a {@link Redirect}. |
476 * The type of a {@link Redirect}. |
480 */ |
477 */ |