584 |
} |
} |
585 |
|
|
586 |
/** |
/** |
587 |
* This used to get an environment variable, but following Sun's lead, |
* Gets the value of an environment variable. |
|
* it now throws an Error. Use <code>getProperty</code> instead. |
|
588 |
* |
* |
589 |
* @param name the name of the environment variable |
* @param name the name of the environment variable |
590 |
* @return this does not return |
* @return the string value of the variable or null when the |
591 |
* @throws Error this is not supported |
* environment variable is not defined. |
592 |
* @deprecated use {@link #getProperty(String)}; getenv is not supported |
* @throws NullPointerException |
593 |
|
* @throws SecurityException if permission is denied |
594 |
|
* @since 1.5 |
595 |
*/ |
*/ |
596 |
public static String getenv(String name) |
public static String getenv(String name) |
597 |
{ |
{ |
598 |
throw new Error("getenv no longer supported, use properties instead: " |
if (name == null) |
599 |
+ name); |
throw new NullPointerException(); |
600 |
|
SecurityManager sm = Runtime.securityManager; // Be thread-safe. |
601 |
|
if (sm != null) |
602 |
|
sm.checkPermission(new RuntimePermission("getenv." + name)); |
603 |
|
return VMSystem.getenv(name); |
604 |
} |
} |
605 |
|
|
606 |
/** |
/** |