From 9f17a7afd2a4fa6175e8ab1551701f38951876eb Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 31 Dec 2002 22:50:10 +0000 Subject: re PR libgcj/7416 (java.security startup refs "GNU libgcj.security") Fix for PR libgcj/7416: * javax/naming/InitialContext.java (init): Use gnu.classpath.home.url. * java/security/Security.java: Use new properties. (loadProviders): Accept base url; use it. * java/lang/System.java: Document gnu.classpath.vm.shortname, and gnu.classpath.home.url. (gnu.classpath.home.url): Define. (gnu.classpath.vm.shortname): Likewise. From-SVN: r60722 --- libjava/javax/naming/InitialContext.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'libjava/javax/naming') diff --git a/libjava/javax/naming/InitialContext.java b/libjava/javax/naming/InitialContext.java index 99ae426..705e24a 100644 --- a/libjava/javax/naming/InitialContext.java +++ b/libjava/javax/naming/InitialContext.java @@ -1,5 +1,5 @@ /* InitialContext.java -- - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -126,18 +126,22 @@ public class InitialContext implements Context } catch (IOException e) {} - String home = System.getProperty("java.home"); + String home = System.getProperty("gnu.classpath.home.url"); if (home != null) { - String fileName = home + File.separator - + "lib" + File.separator + "jndi.properties"; + String url = home + "/jndi.properties"; Properties p = new Properties (); - try { - InputStream is = new FileInputStream (fileName); - p.load (is); - is.close (); - } catch (IOException e) {} + try + { + InputStream is = new URL(url).openStream(); + p.load (is); + is.close (); + } + catch (IOException e) + { + // Ignore. + } merge (myProps, p); } -- cgit v1.1