get location of java webstart cache directory
i am trying to get the location of the webstart cache directory. i see some posts from 2003 and 2004 that say to use getResource() to figure it out. but that way doesnt seem to work anymore. is there any way that works on 1.5 and 1.6 today?
[247 byte] By [
derek_111a] at [2007-11-27 10:18:41]

# 1
> i ..
Who are you? Would you describe yourself as..
a) a web start application developer/deployer
b) a system administrator
c) an end user
>..am trying to get the location of the webstart cache
> directory.
The reason I ask is that for b) and c) above,
the answer to both getting and changing the
web start location cache is simple.
For a), the answer is 'change the broken
application design', and stop worrying where
the user (or their system administrator, or Sun)
chooses to put the cache this minute.
>.. i see some posts from 2003 and 2004 that
> say to use getResource() to figure it out.
They are apparently idiots. getResource is a
method designed to get URL's to resources
on the class path, not to intimate the internal
workings of something that is not the codes
business.
Perhaps you should have read some of the
more recent discussions that went into great
depth on alternate strategies to pursue.
Look particularly for the posts by dietz333 and
myself.
This became a huge problem recently when,
in 1.6, the web start cache was merged with
that of the Java Plug-In. A lot of code that was
relying on this fragile reliance of knowledge
of the cache location, 'fall down go boom'.
>...but that
> way doesnt seem to work anymore.
It was always fragile to the changes in
cache location. It never worked.
>..is there any way
> that works on 1.5 and 1.6 today?
Fix the code.
Try searching those more recent posts,
and if you don't find the answers, try offering
a swag more dukes and a clear explanation
of what the code is trying to achieve (as
opposed to what you want to do) and I
might be able to help further.
Message was edited by:
AndrewThompson64
# 2
i am an application developer.
i have an existing application that uses jdic.
i need to deploy the application via web start.
the application deploys fine in 1.5.
the application does not work correctly in 1.6.
the error i get is in the JdicManager.initShareNative() method at this line:
binaryPath = (new File(binaryPath)).getCanonicalPath();
when reading through the whole method, i determined that the method is trying to determine the binary path of the IeEmbed.exe file in order to communicate with an embedded version of Internet Explorer. It is also trying to setup the class path to include some .dll files.
It was using this logic to get the binary path: (this line came right before the previously mentioned line)
// Find the root path of this class.
binaryPath = (new URL(JdicManager.class.getProtectionDomain()
.getCodeSource().getLocation(), ".")).openConnection()
.getPermission().getName();
i have looked for a more recent version of jdic that fixes this issue. there is none. i have looked through the posts on their group and they acknowldge the problem but dont have a fix for it. i have searched this group for "cache directory" and only posts from 2003 and 2004 came back. i will search this group again.
so, to make jdic work, i NEED to execute IeEmbed.exe, and i need to add some .dll files into the path. if there is a better way of doing it besides getting is location in the cache then please let me know. i was thinking of downloading it manually into some directory of my choice, but that seems a really ugly hack to me.
thanks.