This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 8446 - Moving package (if contains at least one read only file) couses lost of your DATA !!! (FSException is thrown)
Summary: Moving package (if contains at least one read only file) couses lost of your ...
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: akemr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-11-16 16:07 UTC by dmladek
Modified: 2008-12-23 11:51 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dmladek 2000-11-16 16:07:29 UTC
[1152CE] installer class
jdk1.3.0_01-PFCS SUN
=========================

I've discovered this serious bug. Probably it's in DataLoaders.
If you CUT & PASTE package which contains one or more read only files
(doesn't matter what type) to different destination than it is now.
You receive the org.openide.filesystems.FSException (see attachment)
AND !!! Moving continues AND ALL original LOCATION is deleted
AND in NEW ONE there aren't ANY source (JAVA) file !!!!
You've get lost your sources !!!

Steps to reproduce:
===================
1. Mount normal FS.
2. create package pokus.aaa
3. somehow copy whole demo from jdk to your package aaa
   (cp -R $JAVAHOME/demo/ $FS/pokus/aaa). Note that sounds files (au) in
   package sounds.xxx... are read-only. Also note that in subpackages
   of demo exist java, class, html, ... file's types.
4. Right click on pokus.aaa.demo package choose CUT (or ^X)
5. Right click on root of FS and choose PASTE (or ^V)
6. Check now some packages from $FS/demo and look for source files (java)
   You won't find ANYTHING !!!!
Comment 1 Svata Dedic 2000-11-16 16:15:59 UTC
The real cause of that bug is that java.io.File.delete() does its job EVEN IF
the file being deleted is set to read-only in the host OS.
Comment 2 Svata Dedic 2000-11-16 16:27:59 UTC
*** Bug 8447 has been marked as a duplicate of this bug. ***
Comment 3 Pavel Buzek 2000-11-23 12:33:59 UTC
The problem is that DataFolder.handleMove removes the folder even if there were
some problems when moving of the contents. I suggest that when there are any
problems with moving the content the original folder will not be removed.

suggested change in code:
<            fo.delete (lock);
>            if (problem == null) {
>                // delete only if all files were moved
>                fo.delete (lock);
>            }

BTW: notification about problems during move should be nicer (not only display
Exception to the user)
Comment 4 Svata Dedic 2000-11-23 12:44:59 UTC
[Boston-1159, Trunk-77, Release31-14]
The problem is already solved by re-throwing IOException from child operation(s)
before fo.delete(lock); Fixes were propagated to all branches today.
The ugly display is caused by bug in ErrorManager that does not extract
localized message correctly if the exception defines localized message, but is
not annotated.
Comment 5 dmladek 2000-12-01 11:46:59 UTC
verified on [1160CE Boston FCS]
Comment 6 Quality Engineering 2003-07-01 16:14:16 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.