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

Summary: Extend MasterFS and VCS SPI with canWrite()
Product: versioncontrol Reporter: Maros Sandor <msandor>
Component: CodeAssignee: issues@versioncontrol <issues>
Status: RESOLVED FIXED    
Severity: blocker Keywords: API, API_REVIEW_FAST
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 129431    
Attachments: Changes in masterfs
Changes in versioning

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' manifest.mf:

-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
Integrated.

masterfs: e9ad617b5e1d
versioning: 6d9ed610d8ef