[FIXED] AppletLoader temp directory

Started by bobjob, September 19, 2010, 20:31:34

Previous topic - Next topic

bobjob

Quote from: kappa on September 30, 2010, 19:36:16
What would be the opinion to store it in
QuoteSystem.getProperty("user.home") + /.java/lwjglcache
Yeah that sounds like a good idea, also if anyone else wants to use a variation of the applet loader (for non LWJGL use), or are familiar with it, they could also package temp files in the ".java" folder.

kappa

on linux this is a really nice location.

but can any mac users confirm if there is a System.getProperty("user.home")+".java" directory on mac by default?

kappa

ok this issue is now fixed, should be part of lwjgl 2.6.

solution used
Quoteprotected String getCacheDir() {
      String cacheDir = System.getProperty("deployment.user.cachedir");
      
      if (cacheDir == null) {
         cacheDir = System.getProperty("java.io.tmpdir");
      }
      
      return cacheDir + File.separator + "lwjglcache";
   }

bobjob

Sound goods, just a few questions?

With that layout, will an end user be able to clean up resources easy enough, if they want to clean up/make space?

"deployment.user.cachedir" returns a value on Windows, I really think that "java.io.tmpdir" is good for windows, what is the benefit of the "deployment.user.cachedir"?

I think your original idea of a hidden folder in the home directory (if not Windows) is better. Wondering If I understood the new version right?

kappa

Quote from: bobjob on October 08, 2010, 01:05:09
With that layout, will an end user be able to clean up resources easy enough, if they want to clean up/make space?
Search for 'lwjglcache' folder and delete it would be the easy way. Probably could even make an applet to do it for you (like adobe have a flash control panel on their site to allow clearing cookies and various settings).

Quote from: bobjob on October 08, 2010, 01:05:09
"deployment.user.cachedir" returns a value on Windows, I really think that "java.io.tmpdir" is good for windows, what is the benefit of the "deployment.user.cachedir"?
There's not much difference IMO between the two locations on windows, both are equally difficult to find for the average user. Main reason to use "deployment.user.cachedir" is that its a single parameter that can be used on all platforms without getting bogged down in platform specific settings and likely more future proof. Other then that there isn't any big difference, can still be changed if you like.

Quote from: bobjob on October 08, 2010, 01:05:09
I think your original idea of a hidden folder in the home directory (if not Windows) is better. Wondering If I understood the new version right?
Yup was the original idea but wasn't sure how it'd be like on Mac, after reading a few documents on the apple site, they actually recommend that application cache be stored at ~/Library/Caches/* so using the above parameter automatically puts cache files in the recommended location.

bobjob

Quote
There's not much difference IMO between the two locations on windows, both are equally difficult to find for the average user. Main reason to use "deployment.user.cachedir" is that its a single parameter that can be used on all platforms without getting bogged down in platform specific settings and likely more future proof. Other then that there isn't any big difference, can still be changed if you like.
The 2 Folder act very different on Windows, If you open the disks Properties and select "Disk Cleanup" or if hard drive space is getting slim it will show a popup its self, you can remove the temporary files (from the temp dir).

kappa

Quote from: bobjob on October 08, 2010, 09:22:35
The 2 Folder act very different on Windows, If you open the disks Properties and select "Disk Cleanup" or if hard drive space is getting slim it will show a popup its self, you can remove the temporary files (from the temp dir).
Fair enough, good point. Will change Windows back to using "java.io.tmpdir". Be cool to be able to hook up the files to the java cache so that they can be cleared from the java control panel but don't think their is any easy way to do this.

kappa