X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;h=fe73f7f51351ee44b3b664ced844f4f063894871;hb=b4f9071c1bd4534e9cca989f1e873310c94986c3;hp=82f442791b673262932988b4f3c054cc031e10e0;hpb=ae78e5179d241ca5e2439048f960fe6d4a07c990;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index 82f4427..fe73f7f 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -108,12 +108,16 @@ public class Instance { String remoteLib = config.getString(Config.DEFAULT_LIBRARY); if (remoteLib == null || remoteLib.trim().isEmpty()) { + String libDir = System.getProperty("fanfix.libdir"); + if (libDir == null || libDir.isEmpty()) { + config.getString(Config.LIBRARY_DIR); + } try { - lib = new LocalLibrary(getFile(Config.LIBRARY_DIR)); + lib = new LocalLibrary(getFile(libDir)); } catch (Exception e) { tracer.error(new IOException( "Cannot create library for directory: " - + getFile(Config.LIBRARY_DIR), e)); + + getFile(libDir), e)); } } else { int pos = remoteLib.lastIndexOf(":"); @@ -405,9 +409,23 @@ public class Instance { * @return the home */ private static String getHome() { - String home = System.getProperty("user.home"); + String home = System.getProperty("fanfix.home"); + if (home != null && new File(home).isFile()) { + home = null; + } + + if (home == null || home.trim().isEmpty()) { + home = System.getProperty("user.home"); + if (!new File(home).isDirectory()) { + home = null; + } + } + if (home == null || home.trim().isEmpty()) { home = System.getProperty("java.io.tmpdir"); + if (!new File(home).isDirectory()) { + home = null; + } } if (home == null) {