Instance.init()
[nikiroo-utils.git] / src / be / nikiroo / fanfix / Instance.java
index ef7799fbc497d246e7d64ddaf80f8d0cde59546f..84a583e6635d8ec966c7fb8cf1ef334ecaa0bb9a 100644 (file)
@@ -42,7 +42,21 @@ public class Instance {
        private static TraceHandler tracer;
        private static TempFiles tempFiles;
 
-       static {
+       private static boolean init;
+
+       /**
+        * Initialise the instance -- if already initialised, nothing will happen.
+        * <p>
+        * Before calling this method, you may call {@link Bundles#getDirectory()}
+        * if wanted.
+        */
+       static public void init() {
+               if (init) {
+                       return;
+               }
+
+               init = true;
+
                // Before we can configure it:
                Boolean debug = checkEnv("DEBUG");
                boolean trace = debug != null && debug;