Hello Guest

[FIXED] AppletLoader temp directory

  • 22 Replies
  • 38597 Views
*

Offline bobjob

  • ****
  • 394
  • LWJGL: WOW SO GOOD
Re: AppletLoader temp directory
« Reply #15 on: September 30, 2010, 19:39:50 »
What would be the opinion to store it in
Quote
System.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.

*

Offline kappa

  • *****
  • 1319
Re: AppletLoader temp directory
« Reply #16 on: September 30, 2010, 20:19:55 »
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?

*

Offline kappa

  • *****
  • 1319
Re: AppletLoader temp directory
« Reply #17 on: October 07, 2010, 20:34:41 »
ok this issue is now fixed, should be part of lwjgl 2.6.

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

*

Offline bobjob

  • ****
  • 394
  • LWJGL: WOW SO GOOD
Re: AppletLoader temp directory
« Reply #18 on: October 08, 2010, 01:05:09 »
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?

*

Offline kappa

  • *****
  • 1319
Re: AppletLoader temp directory
« Reply #19 on: October 08, 2010, 09:08:02 »
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).

"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.

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.

*

Offline bobjob

  • ****
  • 394
  • LWJGL: WOW SO GOOD
Re: AppletLoader temp directory
« Reply #20 on: October 08, 2010, 09:22:35 »
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).

*

Offline kappa

  • *****
  • 1319
Re: AppletLoader temp directory
« Reply #21 on: October 08, 2010, 09:40:53 »
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.
« Last Edit: October 08, 2010, 09:44:50 by kappa »

*

Offline kappa

  • *****
  • 1319
Re: AppletLoader temp directory
« Reply #22 on: October 09, 2010, 12:17:36 »
ok fixed.