amir-jakoby / crawler-commons

Automatically exported from code.google.com/p/crawler-commons
0 stars 0 forks source link

[Sitemaps] Add new parseSiteMap method #62

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The patch attached adds a new method to detect the mimetype from the byte array 
provided and uses that for the existing parseSiteMap(URL onlineSitemapUrl) 
method.

Please review.

Original issue reported on code.google.com by digitalpebble on 19 Jan 2015 at 4:43

Attachments:

GoogleCodeExporter commented 8 years ago
Reviewed and ran it.

I am +1

Original comment by avrah...@gmail.com on 20 Jan 2015 at 12:10

GoogleCodeExporter commented 8 years ago
One suggestion though

I think you ought to add a check for the URL to be sure it is not null (if it 
is then return null) like in the original method or else a NPE will be thrown.
(Maybe check the byte array also ? )

Original comment by avrah...@gmail.com on 20 Jan 2015 at 1:14

GoogleCodeExporter commented 8 years ago
Thanks for the suggestion Avi. I added the check and also modified the Tester 
class so that it uses the new method if the mimetype isn't set by the user.

Committed revision 157.

Original comment by digitalpebble on 21 Jan 2015 at 9:00

GoogleCodeExporter commented 8 years ago
Thanks for the suggestion Avi. I added the check and also modified the Tester 
class so that it uses the new method if the mimetype isn't set by the user.

Committed revision 157.

Original comment by digitalpebble on 21 Jan 2015 at 9:00