+ public void setVersionChecked() {
+ try {
+ IOUtils.writeSmallFile(new File(configDir), "LAST_UPDATE", Long.toString(new Date().getTime()));
+ } catch (IOException e) {
+ tracer.error(e);
+ }
+ }
+
+ /**
+ * The facility to use temporary files in this program.
+ * <p>
+ * <b>MUST</b> be closed at end of program.
+ *
+ * @return the facility
+ */
+ public TempFiles getTempFiles() {
+ return tempFiles;
+ }
+
+ /**
+ * The configuration directory (will check, in order of preference, the system
+ * properties, the environment and then defaults to
+ * {@link Instance#getHome()}/.fanfix).
+ *
+ * @return the config directory
+ */
+ private String getConfigDir() {
+ String configDir = System.getProperty("CONFIG_DIR");
+
+ if (configDir == null) {
+ configDir = System.getenv("CONFIG_DIR");
+ }
+
+ if (configDir == null) {
+ configDir = new File(getHome(), ".fanfix").getPath();
+ }
+
+ return configDir;
+ }
+
+ /**
+ * Create the config variables ({@link Instance#config},
+ * {@link Instance#uiconfig}, {@link Instance#trans} and
+ * {@link Instance#transGui}).
+ *
+ * @param configDir the directory where to find the configuration files
+ * @param refresh TRUE to reset the configuration files from the default
+ * included ones
+ */
+ private void createConfigs(String configDir, boolean refresh) {
+ if (!refresh) {
+ Bundles.setDirectory(configDir);
+ }
+
+ try {
+ config = new ConfigBundle();
+ config.updateFile(configDir);
+ } catch (IOException e) {
+ tracer.error(e);
+ }
+