equal
deleted
inserted
replaced
32 import java.util.*; |
32 import java.util.*; |
33 import java.io.File; |
33 import java.io.File; |
34 import java.io.FileDescriptor; |
34 import java.io.FileDescriptor; |
35 import java.io.IOException; |
35 import java.io.IOException; |
36 import java.io.PrintStream; |
36 import java.io.PrintStream; |
37 import java.security.AccessController; |
|
38 |
37 |
39 import sun.net.sdp.SdpSupport; |
38 import sun.net.sdp.SdpSupport; |
40 import sun.security.action.GetPropertyAction; |
39 import sun.security.action.GetPropertyAction; |
41 |
40 |
42 /** |
41 /** |
55 // logging for debug purposes |
54 // logging for debug purposes |
56 private PrintStream log; |
55 private PrintStream log; |
57 |
56 |
58 public SdpProvider() { |
57 public SdpProvider() { |
59 // if this property is not defined then there is nothing to do. |
58 // if this property is not defined then there is nothing to do. |
60 String file = AccessController.doPrivileged( |
59 String file = GetPropertyAction.getProperty("com.sun.sdp.conf"); |
61 new GetPropertyAction("com.sun.sdp.conf")); |
|
62 if (file == null) { |
60 if (file == null) { |
63 this.enabled = false; |
61 this.enabled = false; |
64 this.rules = null; |
62 this.rules = null; |
65 return; |
63 return; |
66 } |
64 } |
75 } |
73 } |
76 } |
74 } |
77 |
75 |
78 // check if debugging is enabled |
76 // check if debugging is enabled |
79 PrintStream out = null; |
77 PrintStream out = null; |
80 String logfile = AccessController.doPrivileged( |
78 String logfile = GetPropertyAction.getProperty("com.sun.sdp.debug"); |
81 new GetPropertyAction("com.sun.sdp.debug")); |
|
82 if (logfile != null) { |
79 if (logfile != null) { |
83 out = System.out; |
80 out = System.out; |
84 if (logfile.length() > 0) { |
81 if (logfile.length() > 0) { |
85 try { |
82 try { |
86 out = new PrintStream(logfile); |
83 out = new PrintStream(logfile); |