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 130044 - Extend MasterFS and VCS SPI with canWrite()
Summary: Extend MasterFS and VCS SPI with canWrite()
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@versioncontrol
Depends on:
Blocks: 129431
  Show dependency tree
Reported: 2008-03-13 15:02 UTC by Maros Sandor
Modified: 2008-03-20 16:28 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:

Changes in masterfs (7.14 KB, text/plain)
2008-03-13 17:48 UTC, Maros Sandor
Changes in versioning (8.49 KB, text/plain)
2008-03-13 18:34 UTC, Maros Sandor

Note You need to log in before you can comment on or make changes to this bug.
Description Maros Sandor 2008-03-13 15:02:39 UTC
We need to intercept calls to FileObject.canWrite() in the following scenarios:

1) User wants to delete a file and the file is read-only - in this case the Delete action is currently disabled even if
the file can be normally deleted with a VCS command (clearcase remove)
2) User wants to move a directory that contains read-only files - the operation currently fails in the middle when it
checks DataObject.isMovable() - we can also successfully move the file with an appropriate VCS command

FileObject.canWrite() would be intercepted and, depending on the underlying VCS, eventually return TRUE even for
read-only files.

The change is in MasterFS friend API and also in Versioning SPI, I'll attach separate diffs for both modules.
Comment 1 Maros Sandor 2008-03-13 17:48:45 UTC
Created attachment 58339 [details]
Changes in masterfs
Comment 2 Maros Sandor 2008-03-13 18:34:11 UTC
Created attachment 58342 [details]
Changes in versioning
Comment 3 Maros Sandor 2008-03-13 18:37:08 UTC
Performance-wise, isMutable() in the master interceptor only delegates to the owner (versioning system) of the file only
if the file is a normal file, it exists and is not currently writable.
Comment 4 Jaroslav Tulach 2008-03-13 20:55:38 UTC
Y01 manifest version is 1.14, since is 2.14 both shall be 2.14
Comment 5 Maros Sandor 2008-03-14 10:13:09 UTC
Y01: Ok, I will use 2.14 instead of 1.14 in masterfs'

-OpenIDE-Module-Specification-Version: 1.13
+OpenIDE-Module-Specification-Version: 2.14
Comment 6 Jesse Glick 2008-03-14 21:33:06 UTC
BTW it would be nice if someone would fix all the unchecked warnings so you could write

for (AnnotationProvider provider : annotationProviders) {...}
Comment 7 Maros Sandor 2008-03-20 16:28:08 UTC

masterfs: e9ad617b5e1d
versioning: 6d9ed610d8ef