LWJGLInstaller: Rename watermark file to .lwjglinuse

This commit is contained in:
Elias Naur 2006-07-11 18:55:35 +00:00
parent 9dfe05a126
commit 02d9944b2f
1 changed files with 6 additions and 3 deletions

View File

@ -69,6 +69,9 @@ public class LWJGLInstaller {
/** Directory all lwjgl installations go into */ /** Directory all lwjgl installations go into */
private static final String MASTER_INSTALL_DIR = ".lwjglinstall"; private static final String MASTER_INSTALL_DIR = ".lwjglinstall";
/** Directory all lwjgl installations go into */
private static final String WATERMARK_FILE = ".lwjglinuse";
/** Name of the native jar we're expected to load and install */ /** Name of the native jar we're expected to load and install */
private static final String NATIVES_PLATFORM_JAR = "/" + LWJGLUtil.getPlatformName() + "_natives.jar"; private static final String NATIVES_PLATFORM_JAR = "/" + LWJGLUtil.getPlatformName() + "_natives.jar";
@ -263,7 +266,7 @@ public class LWJGLInstaller {
* Creates the temporary dir to store lwjgl files in. * Creates the temporary dir to store lwjgl files in.
* The temporary dir will be created in the users temp dir and * The temporary dir will be created in the users temp dir and
* called 'lwjgl-' and appended System.currentTimeMillis(). A watermark file * called 'lwjgl-' and appended System.currentTimeMillis(). A watermark file
* called '.lwjglinstaller' will also be created in the directory. * called '.lwjglinuse' will also be created in the directory.
* @return Name of temp directory or null if directory creation failed * @return Name of temp directory or null if directory creation failed
*/ */
private static String createTemporaryDir(final String user_temp_dir) throws Exception { private static String createTemporaryDir(final String user_temp_dir) throws Exception {
@ -277,7 +280,7 @@ public class LWJGLInstaller {
// add the watermark file // add the watermark file
// TODO: Write some info to the file ? // TODO: Write some info to the file ?
File watermark = new File(tempDir.getAbsolutePath() + File.separator + ".lwjglinstaller"); File watermark = new File(tempDir.getAbsolutePath() + File.separator + WATERMARK_FILE);
watermark.createNewFile(); watermark.createNewFile();
watermark.deleteOnExit(); watermark.deleteOnExit();
return tempDir.getAbsolutePath(); return tempDir.getAbsolutePath();
@ -326,7 +329,7 @@ public class LWJGLInstaller {
* @return true if the directory is an install directory * @return true if the directory is an install directory
*/ */
private boolean isStale(File directory) { private boolean isStale(File directory) {
File installFile = new File(directory.getAbsolutePath() + File.separator + ".lwjglinstaller"); File installFile = new File(directory.getAbsolutePath() + File.separator + WATERMARK_FILE);
return !installFile.exists(); return !installFile.exists();
} }