Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-1549

Fix deprecated use of Tika MimeType API in o.a.n.util.MimeUtil

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6, 2.1
    • 2.3, 1.8
    • build
    • None

    Description

      There are still problems with this issue (which actually builds on from the work undertaken by markus17 on NUTCH-1230). I meant to mention and address them ages ago and they recently resurfaced Whilst tackling NUTCH-1273. The following code is deprecated

      170 	// If no mime-type header, or cannot find a corresponding registered
      171 	// mime-type, then guess a mime-type from the url pattern
      172 	type = this.mimeTypes.getMimeType(url) != null ? this.mimeTypes
      173 	.getMimeType(url) : type;
      174 	}
      175 	
      

      Thanks to Nick Burch over on Tika, I attempted to upgrade it to the following

      String mt = getMimeType(url);
      type = mt != null ? mt : type;
      

      Which will of course not compile as the javac rightly flags incompatible types as the error.

      This is present in both trunk and 2.x and we should address it once and for all.

      Attachments

        Issue Links

          Activity

            People

              tejasp Tejas Patil
              lewismc Lewis John McGibbney
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: