X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;h=84a583e6635d8ec966c7fb8cf1ef334ecaa0bb9a;hb=ee9b7083501b94c9ff00ab1d7e481d6f8dec8b05;hp=b6849c279dd298f3b1d1f139367c613a87d9c980;hpb=f83510cf13d55c8700de01ee06ae752da1d102b4;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index b6849c2..84a583e 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -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. + *

+ * 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; @@ -441,6 +455,7 @@ public class Instance { + getFile(libDir), e)); } } else { + Exception ex = null; int pos = remoteLib.lastIndexOf(":"); if (pos >= 0) { String port = remoteLib.substring(pos + 1).trim(); @@ -459,13 +474,14 @@ public class Instance { lib); } catch (Exception e) { + ex = e; } } } if (lib == null) { tracer.error(new IOException( - "Cannot create remote library for: " + remoteLib)); + "Cannot create remote library for: " + remoteLib, ex)); } }