![]() |
|
|||||||
| Feature Discussion Education, discussion and proposals of WWJ features |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2008
Posts: 4
![]() |
Hello,
The configuration key "gov.nasa.worldwind.platform.user.store" used to configure FileStores maps to the "\\Application Data" folder on Windows (this is hardcoded in the AbstractFileStore class in 1.4). On Windows XP and Windows 7, this is the roaming profile (for example on Windows 7, this maps to "C:\Users\johndoe\AppData\Roaming\WorldW indData"), meant to move with you as you log into another computer in a corporate environment, so this is clearly not the best place to store hundreds of megabytes of cache data. It would be nice if:
I know the second option is quite complex (XP and 7 do not use the same folders, and in corporate environment, directories could even be mapped somewhere else), the best way is to use JNA like this: Code:
Shell32Util.getFolderPath( ShlObj.CSIDL_LOCAL_APPDATA ) Thanks! |
|
|
|
|
|
#2 |
|
Super Moderator
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,623
![]() |
\src\config\DataFileStore.xml
You can specify where the cache will be. I don't see a need to have a key in the core code as the .xml file is external and can be changed to whatever a user wants. I do it like this, it works on win and ubuntu or even with the WWJ and C++ apps and cache on a 32GB micro SD card, external hd, usb memory, probably even a peanut butter sandwich if you can get a computer to read it. Code:
<?xml version="1.0"?>
<dataFileStore>
<readLocations>
<location wwDir="..\NLNwwData"/>
<location wwDir="../NLNwwData"/>
</readLocations>
<writeLocations>
<location wwDir="..\NLNwwData" create="true"/>
<location wwDir="../NLNwwData" create="true"/>
<location property="java.io.tmpdir" wwDir="NLNwwData" create="true"/>
</writeLocations>
</dataFileStore>
On 64bit the 64bit jogl files are in another directory with the WWJ app but it could set with -Djava.library.path=. in a .bat or .bash file. You should be able to place the cache anywhere on the lan the computers can get to it. Also look at \src\config\worldwind.xml <Property name="gov.nasa.worldwind.avkey.DataFileS toreConfigurationFileName" value="config/DataFileStore.xml"/> You can set whatever .xml file you want to set your cache location, that is a key you can use. Just my FAA charts are over 3.3GB and that is after switching from .dds to .jpg After deleting ~5GB of VE .dds data the cache is about 10GB. You will end up with several GB of data at least. You registered a while back so welcome to WWJ posting. The "Search" function on the forum and the java.docs are a great help. Last edited by nlneilson; 09-19-2012 at 03:21 AM. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2008
Posts: 4
![]() |
Well, I was trying to put the cache folder somewhere predictable, independently of the location of my Worldwind-based application.
Note that this application could very well be in some read-only directory (like c:\program files), so relative path as shown in your example would not work. The temp directory would work, but it could be flushed on the next reboot (I cannot change group policies). The natural solution would be to store the cache folder into the standard folder for application data, and WorldWind provides an API for this, but its implementation on Windows OS is not exactly what it should be (just look at how the determineSingleUserLocation() method is implemented if you have a doubt, it looks like it was a quick workaround). Anyway, I have found this solution to be working for me: I do not declare any location in the dataFileStore xml node, and I call WorldWind.getFileStore().addLocation( ... ) with the directory I want to use at startup. PS: yes I registered a looong time ago, while testing some early version of WW, then I did something completely different for a few years, and I recently came back with 1.4. I must say there are a lot of nice new features, but you still have to copy-paste a lot of code if you want to customize some very simple features, because key methods are often not overridable... (without modifying the WW codebase of course) |
|
|
|
|
|
#4 | |
|
Super Moderator
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,623
![]() |
Quote:
The example posted seemed to work best on removabe media. Wherever the cache is and can be read the DataFileStore.xml can specify where it is. Like running a WWJ app on Linux and using the cache on Win: <location wwDir="/host/NLN/WWData"/> "... and I call WorldWind.getFileStore().addLocation( ... ) with the directory ..." Well good for you. I like to have a link where anyone just needs to click on it. "... because key methods are often not overridable ..." There have been some where that has been changed. Usually there is a workaround. If you have a specific instance you can post it but a "Search" in the forum will usually find an answer. |
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setting cache directory in Java | nigel_ht | Development Help | 4 | 05-30-2012 10:09 PM |
| SQUID configuration to cache WMS server responses | garakl | Server Discussion | 1 | 08-08-2011 02:16 PM |
| installation puts shortcuts in the current user profile | rpremuz | Bug Reports | 4 | 05-27-2010 04:52 PM |
| what is the cache directory for WWJ? | tieshu | Development Help | 2 | 07-09-2009 02:46 PM |
| WWJ Cache directory structure | gstew77 | Development Help | 1 | 12-05-2007 09:36 PM |