| Summary: | Unmeaningful error message in case of permission denied | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Martijn van Steenbergen <mvsteenbergen> | ||||||
| Component: | Update (deprecated - use Eclipse>Equinox>p2) | Assignee: | Platform-Update-Inbox <platform-update-inbox> | ||||||
| Status: | RESOLVED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Brady.barnard, hugo.a.garcia, lfrenzel, maxime_daniel | ||||||
| Version: | 3.1 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | Macintosh | ||||||||
| OS: | All | ||||||||
| Whiteboard: | obsolete | ||||||||
| Attachments: |
|
||||||||
|
Description
Martijn van Steenbergen
I was not able to reproduce this behaviour on Windows or Linux (haven't got a Mac). On Linux, the error message is about write permissions. However, it is clearly visible from the code what goes wrong, so I fixed at least the ClassCastException. I attached a test case that exposes the bug and a patch with a fix. I was not sure in which package the test case should go, so I stuck with the common practice to put it into the same package where the tested class is. The test will become unnecessary once we switch to Java 5, where problems like this are checked by the compiler already. Depending on when that will be, we won't probably need it in the test suite. Created attachment 29821 [details]
Fixed type problems for internal data structure
Created attachment 29822 [details]
test case that provokes the reported ClassCastException
*** Bug 122930 has been marked as a duplicate of this bug. *** Hi
This problem is caused when code tries to write to a installation directory to which the user does not have write permission. I am writing my own automatic update code and it seems that the the ConfiguredSite.isUpdatable() is not correctly detecting the directory to be read only. I tried the following:
<psuedo>
ConfiguredSite targetSite = the installation site;
Site tSite = (Site) targetSite.getSite();
if (tSite.isReadOnly()) {
logger.log(Level.INFO, "The site is read only");
} else {
logger.log(Level.INFO, "The site is NOT read only");
}
if (targetSite.isUpdatable()) {
logger.log(Level.INFO, "Site is updatable");
} else {
logger.log(Level.INFO, "Site is NOT updatable");
}
</pseudo>
with the install site being read only (Windows) and I get back the following in the logs:
"The site is NOT read only" and "Site is updatable".
When the InstallationJob executes then it fails with the ClassCastException.
=======
As a workaround: I am trying to find a way to get the Location of the installation or plugin directory and grab an IFile instace so that I can test if is is read only or not. Hopefully something like this will work until this problem is resolved.
As a workaround: Platform.getInstallLocation().isReadOnly() correctly detects the installationLocation as read only if the permissions on the directory are deny write in Windows. a simple conditional to avoid the installation job works. This is mainly for people writing their own update managers but it might provide a way to fix this bug. The Eclipse Update component is no longer under development, and no longer exists in the Eclipse Platform 4.x stream. If this problem still occurs in Eclipse Platform 4.2 or later, please enter a new bug report against Equinox p2. Im trying to use this software to download some things but it won't work and i dont know why it will work everytime i trey downloading it seems too be a problem even when I try to swipe my entire computer on the harddrives and uninstall a program or a program that does have a bug.Even when I try installing i try cleaning the software also and it doesnt seem to be working i find it not being helpful or useful and when i try to fix it again it seems to be having the same problems over and over again. |