From d5987c51c9d4ccbd689d009a8cf9fca5944992b7 Mon Sep 17 00:00:00 2001 From: jrandom Date: Fri, 25 Jun 2004 18:32:17 +0000 Subject: [PATCH] yet another deployment option - the user can define a jbigi.ref environmental variable to specify a file from which the name of the resource to be loaded should be found (default is "jbigi.cfg") if that file exists, the NativeBigInteger will act as if jbigi.impl was set to the contents of that file. For instance, a jbigi.cfg containing "win-p4" would have the NativeBigInteger search the classpath for the "win-p4" file and use it as a native library. The jbigi.ref preempts the jbigi.impl property (only if the file exists and is not empty), but the external platform specific jbigi preempts this (e.g. jbigi.dll or libjbigi.so), as does the jbigi.enable flag. This option lets us have the admin console write to a file to choose which jbigi to use, rather than have to parse some shell script, etc --- .../src/net/i2p/util/NativeBigInteger.java | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/core/java/src/net/i2p/util/NativeBigInteger.java b/core/java/src/net/i2p/util/NativeBigInteger.java index 14d2a5db8..c8b538929 100644 --- a/core/java/src/net/i2p/util/NativeBigInteger.java +++ b/core/java/src/net/i2p/util/NativeBigInteger.java @@ -13,7 +13,10 @@ import java.util.Random; import java.security.SecureRandom; import java.net.URL; +import java.io.BufferedReader; +import java.io.InputStreamReader; import java.io.FileOutputStream; +import java.io.FileInputStream; import java.io.InputStream; import java.io.IOException; import java.io.File; @@ -25,9 +28,11 @@ import java.io.File; * GMP library - a collection of insanely efficient routines for dealing with * big numbers.

* - * There are two environmental properties for configuring this component: