Random behaviour in DataObject.find( FileObject )
Paco Barrera <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <CAFS-qL=zJBPiv2mezkyut5JAW6OcMrY4s3vmbG_ysJnnvGg=SQ@mail.gmail.com> |
Hi all,
I have the next code:
if (FileUtil.getMIMEType(deviceA20FO).equals("text/a20+xml")) {
return DataObject.find( deviceA20FO );
} else {
LOGGER.warn("FileObject MIME-Type: " +
FileUtil.getMIMEType(deviceA20FO) );
LOGGER.warn("FileObject content: " + deviceA20FO.asText() );
return null;
}
Randomly, sometimes this returns a good A20DataObject and others returns an
unexpected XMLDataObject.
I check that the mime-type for the FileObject is right, and always executes
"return DataObject.find( deviceA20FO )".
At this point, all depends internally of Netbeans that resolves the
DataLoader for the FileObject mime-type, and returnsa DataObject provided
by the DataLoader.
How is it possible that sometimes resolves the right DataObject and
sometimes bad if always right FileObject mime-type is passed?
Any help is appreciated.