Re: Setting environment variables
Re: Setting environment variables
- Subject: Re: Setting environment variables
- From: Timo Hoepfner <email@hidden>
- Date: Fri, 14 Aug 2009 16:43:44 +0200
Am 14.08.2009 um 15:26 schrieb Timo Hoepfner:
I'm almost about to write a JNA wrapper for setting the environment
programatically...
Done...
import com.sun.jna.Library;
import com.sun.jna.Native;
public class PDEnvironmentUtilities {
private static final CLibrary LIBC = (CLibrary)
Native.loadLibrary("c", CLibrary.class);
public static String getenv(String name) {
return LIBC.getenv(name);
}
public static void setenv(String name, String value) {
if(value == null)
LIBC.unsetenv(name);
else
LIBC.setenv(name, value, 1);
}
// http://www.gnu.org/software/libc/manual/html_node/Environment-Access.html#Environment-Access
private interface CLibrary extends Library {
public int setenv(String name, String value, int replace);
public String getenv(String name);
public int unsetenv(String name);
}
}
Timo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden