From 6f56b23d356078a54256f5c2078b37b55bf12ce9 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 29 Dec 2011 04:56:28 +0000 Subject: [PATCH] * don't use java.io.tmpdir for the persistent cache but our own application folder --- installer/msi/filebot.cmd | 2 +- installer/msi/filebot.launcher.l4j.ini | 1 - .../msi/filebot.platform.launcher.l4j.ini | 1 - installer/portable/FileBot.l4j.ini | 1 - installer/portable/filebot.sh | 2 +- source/ehcache.xml | 231 +++++------------- source/net/sourceforge/filebot/Main.java | 2 + 7 files changed, 69 insertions(+), 171 deletions(-) diff --git a/installer/msi/filebot.cmd b/installer/msi/filebot.cmd index ab8a1d47..0189313f 100644 --- a/installer/msi/filebot.cmd +++ b/installer/msi/filebot.cmd @@ -1,2 +1,2 @@ @ECHO OFF -java -Dapplication.dir="%APPDATA%\FileBot" -Dapplication.deployment=msi -Djava.io.tmpdir="%APPDATA%\FileBot\temp" -Xmx256m -jar "%~dp0FileBot.jar" %* +java -Dapplication.deployment=msi -Dapplication.dir="%APPDATA%\FileBot" -Xmx256m -jar "%~dp0FileBot.jar" %* diff --git a/installer/msi/filebot.launcher.l4j.ini b/installer/msi/filebot.launcher.l4j.ini index e59d15db..43579b6c 100644 --- a/installer/msi/filebot.launcher.l4j.ini +++ b/installer/msi/filebot.launcher.l4j.ini @@ -1,7 +1,6 @@ # FileBot launch4j runtime config -Dapplication.deployment=msi -Dapplication.dir="%APPDATA%\FileBot" --Djava.io.tmpdir="%APPDATA%\FileBot\temp" # memory settings -Xmx256m diff --git a/installer/msi/filebot.platform.launcher.l4j.ini b/installer/msi/filebot.platform.launcher.l4j.ini index fdf8fe6e..64a14da3 100644 --- a/installer/msi/filebot.platform.launcher.l4j.ini +++ b/installer/msi/filebot.platform.launcher.l4j.ini @@ -1,7 +1,6 @@ # FileBot launch4j runtime config -Dapplication.deployment=msi -Dapplication.dir="%APPDATA%\FileBot" --Djava.io.tmpdir="%APPDATA%\FileBot\temp" # memory settings -Xms64m diff --git a/installer/portable/FileBot.l4j.ini b/installer/portable/FileBot.l4j.ini index bb172514..945ad1eb 100644 --- a/installer/portable/FileBot.l4j.ini +++ b/installer/portable/FileBot.l4j.ini @@ -2,7 +2,6 @@ -Dapplication.deployment=portable -Dapplication.dir="%EXEDIR%" -Duser.home="%EXEDIR%" --Djava.io.tmpdir="%EXEDIR%\temp" # memory settings -Xmx256m diff --git a/installer/portable/filebot.sh b/installer/portable/filebot.sh index 7469305c..d6b472a4 100644 --- a/installer/portable/filebot.sh +++ b/installer/portable/filebot.sh @@ -4,4 +4,4 @@ while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done dir_bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )" # WARNING: NOT TESTED / HERE THERE BE DRAGONS -java -Dapplication.deployment=portable -Dapplication.dir="$dir_bin" -Duser.home="$dir_bin" -Djava.io.tmpdir="$dir_bin/temp" -Djna.library.path="$dir_bin" -Djava.util.prefs.PreferencesFactory=net.sourceforge.tuned.prefs.FilePreferencesFactory -Dnet.sourceforge.tuned.prefs.file=prefs.properties -Xmx256m -jar "$dir_app/FileBot.jar" "$@" +java -Dapplication.deployment=portable "-Dapplication.dir=$dir_bin" "-Duser.home=$dir_bin" "-Djna.library.path=$dir_bin" -Djava.util.prefs.PreferencesFactory=net.sourceforge.tuned.prefs.FilePreferencesFactory -Dnet.sourceforge.tuned.prefs.file=prefs.properties -Xmx256m -jar "$dir_app/FileBot.jar" "$@" diff --git a/source/ehcache.xml b/source/ehcache.xml index c8369dec..e842585b 100644 --- a/source/ehcache.xml +++ b/source/ehcache.xml @@ -1,177 +1,76 @@ - - - - + + + - - - - - - + --> + + - - - - - - - + --> + + + + + - - + --> + + diff --git a/source/net/sourceforge/filebot/Main.java b/source/net/sourceforge/filebot/Main.java index f49a4068..1acc90d0 100644 --- a/source/net/sourceforge/filebot/Main.java +++ b/source/net/sourceforge/filebot/Main.java @@ -13,6 +13,7 @@ import java.awt.Dialog.ModalityType; import java.awt.event.ActionEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.io.File; import java.io.IOException; import java.net.URI; import java.nio.ByteBuffer; @@ -266,6 +267,7 @@ public class Main { * Shutdown ehcache properly, so that disk-persistent stores can actually be saved to disk */ private static void initializeCache() { + System.setProperty("ehcache.disk.store.dir", new File(getApplicationFolder(), "cache").getAbsolutePath()); Runtime.getRuntime().addShutdownHook(new Thread() { @Override