+ uiconfig = new UiConfigBundle();
+ trans = new StringIdBundle(getLang());
+ try {
+ lib = new Library(getFile(Config.LIBRARY_DIR),
+ OutputType.INFO_TEXT, OutputType.CBZ);
+ } catch (Exception e) {
+ syserr(new IOException("Cannot create library for directory: "
+ + getFile(Config.LIBRARY_DIR), e));
+ }
+
+ debug = Instance.getConfig().getBoolean(Config.DEBUG_ERR, false);
+ coverDir = getFile(Config.DEFAULT_COVERS_DIR);
+ File tmp = getFile(Config.CACHE_DIR);
+ readerTmp = getFile(UiConfig.CACHE_DIR_LOCAL_READER);
+
+ if (checkEnv("NOUTF")) {
+ trans.setUnicode(false);
+ }
+
+ if (checkEnv("DEBUG")) {
+ debug = true;
+ }
+
+ // Could have used: System.getProperty("java.io.tmpdir")
+ if (tmp == null) {
+ tmp = new File(configDir, "tmp");
+ }
+ if (readerTmp == null) {
+ readerTmp = new File(configDir, "tmp-reader");
+ }
+ //
+
+ if (coverDir != null && !coverDir.exists()) {
+ syserr(new IOException(
+ "The 'default covers' directory does not exists: "
+ + coverDir));
+ coverDir = null;
+ }
+