Java cache file names

I was wondering how Java generates the file names for its temporary cache files and after googling around, I found the answer in the Java source code – the function responsible is called generateCacheFileName and its implementation has changed over the time; here is how they do it in JDK 5 and 6/7:

JDK 5.xx

Files are saved in the following location:

  • %USERPROFILE%\Application Data\Sun\Java\Deployment\
    cache\javapi\v1.0\[cachefilename]

The procedure for generating [cachefilename] is described here:

JDK 6.xx-7.xx

Files are saved in the following location:

  • %USERPROFILE%\Local Settings\Application Data\Sun\Java\Deployment\
    cache\6.0\[cachebucket]\[cachefilename]

The procedure for generating [cachebucket]\[cachefilename] is described here:

The code

I ripped the code from these sources and created a simple java snippet that helps to test cache file name for a given URL. At the moment it has a small bug, but I hope you won’t notice it 🙂

Example – JRE 1.5

I googled around and found an old applet that worked under JRE 1.5, then visited the page so that the cached files could be created; the URL passed to the cachename Java program produces exactly same result:

javacache_1

Example – JRE 1.6-1.7

I simply visited Oracle web page that detects the browser and let the applet load:

javacache_2
Download

You can download the code here.

To compile, run:

javac cachename.java

To execute, run:

java cachename url

 

RegRipper Ripper (3R) and the list of reg keys covered by RR plugins

update

Updated 3R to cover the latest archive from the RegRipper site – plugins20130403.zip (new version introduced over 40 new scripts)

old post

I got curious what keys are already covered by existing 280+ RegRipper Plugins so I wrote a quick and dirty script to retrieve the data from all plugins in an automated way. For the fun of it, I named the script RegRipper Ripper (3R).

The script is here, and the result of running it over the latest bundle is available here.

You may use the list to see what’s already covered and… avoid writing a plugin for a key that is already handled.

The 3R is a dumb script, so a few things I had to fix manually (but still inside the script, so it can be used to regenerate the tables anytime needed, e.g. after the bundle update). I hope there are no mistakes, but if you spot any, please let me know and I will fix that. Thanks!