URLConnection.guessContentTypeFromName() should be public

(A Java bug report by Dan Bornstein)


Bug Id: 4403905
Synopsis: URLConnection.guessContentTypeFromName() should be public
State: In progress, request for enhancement
Submit Date: Jan 11, 2001

Description:

The static method URLConnection.guessContentTypeFromName() is declared
protected, but it ought to be public, since it doesn't do anything that
only subclasses should be able to do. In fact, it's pretty easy to do
a workaround by just reimplementing what it does (presumably just
calls getFileNameMap().getContentTypeFor()) wherever one would have called
the original method.

It's not a huge deal, but it'd be nice to not have to circumlocute.

(Review ID: 114936)

Workaround:

Call getFileNameMap().getContentTypeFor().


January 11, 2001

The Java Rants
Copyright © 1997-2001 Dan Bornstein, all rights reserved.