211 }
212
213
214 /* ---------------- Private members -------------- */
215
216 // ACE Prefix is "xn--"
217 private static final String ACE_PREFIX = "xn--";
218 private static final int ACE_PREFIX_LENGTH = ACE_PREFIX.length();
219
220 private static final int MAX_LABEL_LENGTH = 63;
221
222 // single instance of nameprep
223 private static StringPrep namePrep = null;
224
225 static {
226 InputStream stream = null;
227
228 try {
229 final String IDN_PROFILE = "uidna.spp";
230 if (System.getSecurityManager() != null) {
231 stream = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
232 public InputStream run() {
233 return StringPrep.class.getResourceAsStream(IDN_PROFILE);
234 }
235 });
236 } else {
237 stream = StringPrep.class.getResourceAsStream(IDN_PROFILE);
238 }
239
240 namePrep = new StringPrep(stream);
241 stream.close();
242 } catch (IOException e) {
243 // should never reach here
244 assert false;
245 }
246 }
247
248
249 /* ---------------- Private operations -------------- */
250
251
|
211 }
212
213
214 /* ---------------- Private members -------------- */
215
216 // ACE Prefix is "xn--"
217 private static final String ACE_PREFIX = "xn--";
218 private static final int ACE_PREFIX_LENGTH = ACE_PREFIX.length();
219
220 private static final int MAX_LABEL_LENGTH = 63;
221
222 // single instance of nameprep
223 private static StringPrep namePrep = null;
224
225 static {
226 InputStream stream = null;
227
228 try {
229 final String IDN_PROFILE = "uidna.spp";
230 if (System.getSecurityManager() != null) {
231 stream = AccessController.doPrivileged(new PrivilegedAction<>() {
232 public InputStream run() {
233 return StringPrep.class.getResourceAsStream(IDN_PROFILE);
234 }
235 });
236 } else {
237 stream = StringPrep.class.getResourceAsStream(IDN_PROFILE);
238 }
239
240 namePrep = new StringPrep(stream);
241 stream.close();
242 } catch (IOException e) {
243 // should never reach here
244 assert false;
245 }
246 }
247
248
249 /* ---------------- Private operations -------------- */
250
251
|