equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
41 import java.net.InetAddress; |
41 import java.net.InetAddress; |
42 import java.net.ServerSocket; |
42 import java.net.ServerSocket; |
43 import java.net.Socket; |
43 import java.net.Socket; |
44 import java.net.SocketAddress; |
44 import java.net.SocketAddress; |
45 import java.net.SocketException; |
45 import java.net.SocketException; |
|
46 import java.nio.file.Files; |
46 import java.nio.channels.Channel; |
47 import java.nio.channels.Channel; |
47 import java.nio.channels.ServerSocketChannel; |
48 import java.nio.channels.ServerSocketChannel; |
48 import java.rmi.AccessException; |
49 import java.rmi.AccessException; |
49 import java.rmi.AlreadyBoundException; |
50 import java.rmi.AlreadyBoundException; |
50 import java.rmi.ConnectException; |
51 import java.rmi.ConnectException; |
1938 */ |
1939 */ |
1939 AccessController.doPrivileged( |
1940 AccessController.doPrivileged( |
1940 new PrivilegedExceptionAction<Void>() { |
1941 new PrivilegedExceptionAction<Void>() { |
1941 public Void run() throws IOException { |
1942 public Void run() throws IOException { |
1942 File file = |
1943 File file = |
1943 File.createTempFile("rmid-err", null, null); |
1944 Files.createTempFile("rmid-err", null).toFile(); |
1944 PrintStream errStream = |
1945 PrintStream errStream = |
1945 new PrintStream(new FileOutputStream(file)); |
1946 new PrintStream(new FileOutputStream(file)); |
1946 System.setErr(errStream); |
1947 System.setErr(errStream); |
1947 return null; |
1948 return null; |
1948 } |
1949 } |