Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#26 FormatDetector unable to detect Atomic format

open
nobody
None
5
2004-11-28
2004-11-28
No

The FormatDetector.getFormat method is unable to
detect atomic feeds. I realized the problem when i tried
to parse an atomic feed using the channel registry.

The following code fixes the problem (at least for me ;)

FormatDetector.getFormat() :

...

} else if (rootElement.indexOf("feed") >= 0) {
if (rootElement.indexOf("0.1") >= 0 ||
rootElement.indexOf("0.2") >= 0) {
//logger.info("Channel uses feed root element
(Version " + rootElement + ").");
logger.warn("This atom version is not really
supported yet, assume Atom 0.3 format");
return ChannelFormat.ATOM_0_3;
} else if (rootElement.indexOf("0.3") >= 0) {
logger.info("Channel uses feed root element
(Version 0.3).");
return ChannelFormat.ATOM_0_3;
} else {
throw new UnsupportedFormatException
("Unsupported feed version.");
}

...

Discussion