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 222204

Summary: Allow to get the referenced FileObjects
Product: platform Reporter: Svata Dedic <sdedic>
Component: Data SystemsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal Keywords: API, API_REVIEW_FAST
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 213591    
Attachments: Proposed changes - initial version
updated with Y01

Description Svata Dedic 2012-11-15 12:12:52 UTC
Created attachment 127865 [details]
Proposed changes - initial version

I would like to have access to the FileObject referened by the DataShadow. The FileObject may be invalid or otherwise unsuitable for DataObject creation, as e.g. FileObjects created by enhancement #222202. This added API would allow to detect links to a certain file (e.g. an Action registration) and even in the case of deleted or changed files on a MultiFileSystem.

After discussion with jtulach, I propose to create an 

public static FileObject findOriginal(FileObject shadow)

and refactor the current protected deserialize() method so that the processing is in findOriginal, and deserialize() just wraps it.

Please see the attached diff for proposed changes.
Comment 1 Jaroslav Tulach 2012-11-16 09:05:38 UTC
Y01 Is not there an incompatible change in the deserialize behavior? Previously one could (probably) deserialize file with any extension. Now the extension is restricted to .shadow, I think. Btw. there is FileObject.hasExt(...) method.
Comment 2 Svata Dedic 2012-11-16 09:09:32 UTC
Y01: right - apologies; seems as leftover from prototype coding, not an intention. Will remove.
Comment 3 Svata Dedic 2012-11-20 12:00:11 UTC
Created attachment 128124 [details]
updated with Y01
Comment 4 Jaroslav Tulach 2012-11-21 08:23:15 UTC
OK. Except the typo: org.openide.loaderss
Comment 5 Svata Dedic 2012-11-23 16:18:08 UTC
No further input, I'll correct the typo & commit.
Comment 6 Svata Dedic 2012-11-23 16:41:34 UTC
Changeset: 5690f8401eea
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2012-11-23 17:41
Message:   Implemented findOriginal() to get the referenced FIleObject.
Comment 7 Quality Engineering 2012-11-24 13:07:12 UTC
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/5690f8401eea
User: Svata Dedic <sdedic@netbeans.org>
Log: Issue #222204 - Allow to get the referenced FileObjects: fixed
Implemented findOriginal() to get the referenced FIleObject.