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.
Created attachment 127863 [details] Proposed changes - initial version Currently we have FileObject.revert(), which can discard user changes for existing files on writable layer of MFS among other things. But if the files does not exist at all, there's no FileObject to call revert() on. In addition, it may be useful to be able to read attributes and contents of the deleted file (or the original version of the file) in order to decide whether the file should be revert()ed or not. The current FS API does not allow such inspection. I propose to add a 'development' stability pseudo API - an additional FileObject attribute "revealEntries" on FileObjects representing folders. The value of such attribute would be typed Collection<? extends FileObject>. If the FS does not support the feature (i.e. not MultiFileSystem, or MultiFileSystem without writable layer - effectively unable to revert() changes), the returned value would be null. In addition, the returned FileObjects would implement Callable<FileObject> interface - public FileObject call(). If called, the changes for the file will be reverted on the writable layer, and the revived MultiFileObject will be returned to the caller (if exists). Those FileObjects should be guarded against DataObject creation, as there could be 2 DataObjects for the same path, which would do no good - I propose that the returned FileObjects should be isValid() == false from the start. Next, references to the fileObject.getParent() or getChildren() should not reveal lower layers of the MultiFileSystem; so I propose that the returned FileObjects would be formally part of the MultiFileSytem, under a proper parent, and with appropriate MFS children. As the information for deleted/original content is represented as FileObject, the caller may inspect any attribute, content or flags; this would be hard to achive with other API type - only a subset of information could be exposed. See the attached patch against openide.filesystems for proposed API/implementation/tests.
Created attachment 127869 [details] Testcases Sorry, I've forgot to include tests in the patch, only changed test infrastructure was present. See the additional attachment.
Y01 Jesse used to say apichanges.xml is just for a short note about the change, not about describing the behavior. In this case I think the description should be in arch.xml <api group="property/layer">... Btw. nice fluent testing infrastructure improvement "add(...).withContent(...)"
Created attachment 128123 [details] processed Y01 Y01: noted in arch.xml, shortened entry in apichanges.xml, linked to and explained in MFS javadoc.
No further input, will commit
Changeset: 5f829ca35154 Author: Svata Dedic <sdedic@netbeans.org> Date: 2012-11-23 17:12 Message: Attempt to sync NB eclipse keymap with Eclipse Indigo release.
aargh, please disregard the last comment; I'll recommit with the correct message.
Changeset: 0ee9a484eb9f Author: Svata Dedic <sdedic@netbeans.org> Date: 2012-11-23 17:15 Message: Implemented "revealEntries" attribute on MFObject
Integrated into 'main-golden', will be available in build *201211240959* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/0ee9a484eb9f User: Svata Dedic <sdedic@netbeans.org> Log: Issue #222202 - Reveal deleted or changed files on MultiFileSystem: fixed Implemented "revealEntries" attribute on MFObject