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 - Allow to get the referenced FileObjects
Summary: Allow to get the referenced FileObjects
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 213591
  Show dependency tree
 
Reported: 2012-11-15 12:12 UTC by Svata Dedic
Modified: 2012-11-24 13:07 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed changes - initial version (6.61 KB, patch)
2012-11-15 12:12 UTC, Svata Dedic
Details | Diff
updated with Y01 (6.52 KB, patch)
2012-11-20 12:00 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.